1.20.x node.pages.inc node_add($type)

Page callback: Provides the node submission form.

Parameters

$type: The node type for the submitted node.

Return value

Returns a node submission form.:

See also

node_menu()

File

modules/node/node.pages.inc, line 68
Callbacks for adding, editing, and deleting content and managing revisions.

Code

function node_add($type) {
  global $user;

  $types = node_type_get_types();
  $node = entity_create('node', array(
    'uid' => $user->uid,
    'name' => (isset($user->name) ? $user->name : ''),
    'type' => $type,
    'langcode' => LANGUAGE_NONE,
  ));
  backdrop_set_title(t('Create @name', array('@name' => t($types[$type]->name))), PASS_THROUGH);
  $output = backdrop_get_form($type . '_node_form', $node);

  return $output;
}