If we want to alter a node form of a specific content type using hook_form_alter(), we may want to know whether the form is for node creation or edit. In this case, we can add a checking as follow:
function <module>_form_<content-type>_node_form_alter(&$form, &$form_state, $form_id) { $node = $form_state['node']; if (isset($node ->nid)) { // Node edit } else { // Node add } }
Done =)