hook_node_insert

Versions
mediamosa-21
hook_node_insert($node)

Respond to creation of a new node.

This hook is invoked from node_save() after the node is inserted into the node table in the database, after the type-specific hook_insert() is invoked, and after field_attach_insert() is called.

Parameters

$node The node that is being created.

Related topics

Code

modules/node/node.api.php, line 430

<?php
function hook_node_insert($node) {
  db_insert('mytable')
    ->fields(array(
      'nid' => $node->nid,
      'extra' => $node->extra,
    ))
    ->execute();
}
?>