function content_form_alter

7.x content.module content_form_alter(&$form, $form_id)
6.x content.module content_form_alter(&$form, $form_id)

Hook form alter, to set some defaults.

File

modules/content/content.module, line 2012

Code

function content_form_alter(&$form, $form_id) {

  if ($form_id == 'content_edit_content_form') {

    // This is a NEW form.      
    if ($form ['cid']['value'] === 'new') {

      // Always set the published = TRUE, and hide.        
      $form ['published']['value'] = TRUE;
      $form ['published']['attributes'] = array('class' => 'hidden');


      // Set visibility to 'faculty' by default, if it exists.
      if (isset($form ['visibility'])) {
        $form ['visibility']['value'] = 'faculty';
      }

    } // if "new"




  } // if form_id   


}