function hook_node_delete

Respond to node deletion.

This hook is invoked from entity_delete_multiple() after field_attach_delete() has been called and after the node has been removed from the database.

Parameters

\Drupal\Core\Entity\EntityInterface $node: The node that has been deleted.

See also

hook_node_predelete()

entity_delete_multiple()

Related topics

2 functions implement hook_node_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_crud_hook_test_node_delete in drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.module
Implements hook_node_delete().
history_node_delete in drupal/core/modules/history/history.module
Implements hook_node_delete().

File

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

Code

function hook_node_delete(\Drupal\Core\Entity\EntityInterface $node) {
  drupal_set_message(t('Node: @title has been deleted', array(
    '@title' => $node
      ->label(),
  )));
}