How can I print the variables of Drupal's node add/edit and comment forms?
I've tried print_r($form);
It returns NULL
.
Here's my module:
function comment_mod_form_alter(&$form, $form_state, $form_id) {
if (i开发者_JS百科n_array($form_id, array('comment_form'))) {
unset($form['homepage']); // this works
print_r($form);
}
}
Are you implementing the hook_form_alter(&$form, &$form_state, $form_id) function in your module? This will be called for all forms, so if you add your calls and visit the node add/edit page you should see some output. From what you've said I don't see why it wouldn't.
精彩评论