hook_form_alter multiple Content Type How I use hook_form_alter with multiple Content Type..

function custom_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'register_node_form' || 'session_node_form'){

  if(empty($form['field_event_ref']['und'][0]['nid']['#default_value']))
     {
    $form['field_event_ref']['und'][0]['nid']['#default_value'] = arg(3);
     }
    $form['field_event_ref']['und'][0]['nid']['#disabled'] = True;
     }
  }


I want Here to Get Both Of (Register) and (Session) Content type to be alter..
The code is incorrect, it should be:

function custom_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'register_node_form' || $form_id == 'session_node_form') {
    // code here that alters forms for both content types
  }
}


The if statement is missing the second $form_id.

Also, I wouldn't name the module custom. If you are doing that as a demonstration purpose, a typical convention is to use mymodule_ in posts.

A more readable way:

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $content_type_forms = array('register_node_form', 'session_node_form');

  if (in_array($form_id, $content_type_forms)) {
    // code here that alters forms for certain content types
  }
}