content_form_alter

5 content.module content_form_alter($form_id, &$form)
6 content.module content_form_alter(&$form, $form_state, $form_id)

Implementation of hook_form_alter().

File

contributions/cck/content.module, line 440
Allows administrators to associate custom fields to content types.

Code

function content_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id) {
    $type = content_types($form['#node']->type);
    if (!empty($type['fields'])) {
      module_load_include('inc', 'content', 'includes/content.node_form');
      // Merge field widgets.
      $form = array_merge($form, content_form($form, $form_state));
    }
    $form['#pre_render'][] = 'content_alter_extra_weights';
    $form['#content_extra_fields'] = $type['extra'];
  }
}