0
votes

I havea quick question regarding hook_form. Does it work on custom content types created outside of module using the drupal cotent type interface? Of does it only work on content types created in your module?

If it does not work on custom content types defined outside the module what would you reccomend?

1

1 Answers

1
votes

hook_form_alter is how you would modify the add/edit form of content types that were not created by your module.


For example:

/**
 * Implementation of hook_form_FORMID_alter() for "CONTENTNAME_node_form".
 */
function MODULENAME_form_CONTENTNAME_node_form_alter(&$form, &$form_state){
    // Hides the "promote to front page" option
    $form['options']['promote']['#access'] = 0;
}