node_add
function node_add
node_add($type)
Returns a node submission form.
Parameters
$type: The node type for the submitted node.
Return value
The themed form.
File
- modules/node/node.pages.inc, line 72
- Page callbacks for adding, editing, deleting, and revisions management for content.
Code
function node_add($type) { global $user; $types = node_type_get_types(); $node = (object) array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => LANGUAGE_NONE); drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH); $output = drupal_get_form($type . '_node_form', $node); return $output; }