| 5 node.module | node_add($type = NULL) |
| 6 node.pages.inc | node_add($type) |
| 7 node.pages.inc | node_add($type) |
| 8 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
1 string reference to 'node_add'
File
- core/
modules/ node/ node.pages.inc, line 81 - 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_NOT_SPECIFIED,
));
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH);
$output = drupal_get_form($type . '_node_form', $node);
return $output;
}
Login or register to post comments