hook_update
function hook_update
hook_update($node)
Respond to updates to a node.
This is a node-type-specific hook, which is invoked only for the node type being affected. See Node API hooks for more information.
Use hook_node_update() to respond to node update of all node types.
This hook is invoked from node_save() after the node is updated in the node table in the database, before field_attach_update() is called, and before hook_node_update() is invoked.
Parameters
$node: The node that is being updated.
Related topics
File
- modules/node/node.api.php, line 1236
- Hooks provided by the Node module.
Code
function hook_update($node) { db_update('mytable') ->fields(array('extra' => $node->extra)) ->condition('nid', $node->nid) ->execute(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_update/7.x