Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
hook_delete(&$node)
documentation/hooks/node.php, line 174
Respond to node deletion.
This is a hook used by node modules. It is called to allow the module to take action when a node is being deleted from the database by, for example, deleting information from related tables.
To take action when nodes of any type are deleted (not just nodes of the type defined by this module), use hook_nodeapi() instead.
For a detailed usage example, see node_example.module.
&$node The node being deleted.
None.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_delete(&$node) {
db_query('DELETE FROM {mytable} WHERE nid = %d', $node->nid);
}
?>