function hook_delete
Same name and namespace in other branches
- 6.x documentation-6.x/developer/hooks/node.php \hook_delete()
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
82 functions implement hook_delete()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- actions_delete in drupal-7.x/
includes/ actions.inc - Deletes a single action from the database.
- block_custom_block_delete in drupal-7.x/
modules/ block/ block.admin.inc - Form constructor for the custom block deletion form.
- block_menu_delete in drupal-7.x/
modules/ block/ block.module - Implements hook_menu_delete().
- block_user_role_delete in drupal-7.x/
modules/ block/ block.module - Implements hook_user_role_delete().
- book_node_delete in drupal-7.x/
modules/ book/ book.module - Implements hook_node_delete().
3 invocations of hook_delete()
- field_attach_delete in drupal-7.x/
modules/ field/ field.attach.inc - Delete field data for an existing entity. This deletes all revisions of field data for the entity.
- field_purge_data in drupal-7.x/
modules/ field/ field.crud.inc - Purges the field data for a single field on a single pseudo-entity.
- node_delete_multiple in drupal-7.x/
modules/ node/ node.module - Deletes multiple nodes.
Archivo
- drupal-7.x/
modules/ node/ node.api.php, line 1045 - Hooks provided by the Node module.
Código
function hook_delete($node) {
db_delete('mytable')->condition('nid', $node->nid)->execute();
}