hook_node_delete
function hook_node_delete
hook_node_delete($node)
Respond to node deletion.
This hook is invoked from node_delete_multiple() after the type-specific hook_delete() has been invoked, but before hook_entity_delete and field_attach_delete() are called, and before the node is removed from the node table in the database.
Parameters
$node: The node that is being deleted.
Related topics
File
- modules/node/node.api.php, line 475
- Hooks provided by the Node module.
Code
function hook_node_delete($node) { db_delete('mytable') ->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_node_delete/7.x