1 node.api.php hook_node_revision_delete(Node $node)

Respond to deletion of a node revision.

This hook is invoked from node_revision_delete() after the revision has been removed from the node_revision table, and before field_attach_delete_revision() is called.

Parameters

Node $node: The node revision (node object) that is being deleted.

Related topics

File

core/modules/node/node.api.php, line 444
Hooks provided by the Node module.

Code

function hook_node_revision_delete(Node $node) {
  db_delete('mytable')
    ->condition('vid', $node->vid)
    ->execute();
}