function node_add
7.x node.pages.inc | node_add($type) |
6.x node.pages.inc | node_add($type) |
Returns a node submission form.
Parameters
$type: The node type for the submitted node.
Return value
The themed form.
1 string reference to 'node_add'
- node_menu in drupal-7.x/
modules/ node/ node.module - Implements hook_menu().
File
- drupal-7.x/
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;
}