hook_delete

Versions
4.6 – 6
hook_delete(&$node)
7
hook_delete($node)

Respond to node deletion.

This hook is invoked only on the module that defines the node's content type (use hook_node_delete() to respond to all node deletions).

This hook is invoked from node_delete_multiple() after the node has been removed from the node table in the database, before hook_node_delete() is invoked, and before field_attach_delete() is called.

Parameters

$node The node that is being deleted.

Related topics

Code

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

<?php
function hook_delete($node) {
  db_delete('mytable')
    ->condition('nid', $nid->nid)
    ->execute();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.