function hook_node_delete

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 node.api.php hook_node_delete($node)
cle7 node.api.php hook_node_delete($node)
elmsmedia7 node.api.php hook_node_delete($node)
icor7 node.api.php hook_node_delete($node)
meedjum_blog7 node.api.php hook_node_delete($node)
mooc7 node.api.php hook_node_delete($node)

Respond to node deletion.

This hook is invoked from node_delete_multiple() after the type-specific hook_delete() has been invoked, but before hook_entity_delete and field_attach_delete() are called, and before the node is removed from the node table in the database.

Parameters

$node: The node that is being deleted.

Related topics

16 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.

book_node_delete in modules/book/book.module
Implements hook_node_delete().
comment_node_delete in modules/comment/comment.module
Implements hook_node_delete().
entity_crud_hook_test_node_delete in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_node_delete().
feeds_node_delete in sites/all/modules/ulmus/feeds/feeds.module
Implements hook_node_delete().
forum_node_delete in modules/forum/forum.module
Implements hook_node_delete().

... See full list

5 invocations of hook_node_delete()
EntityAPIController::delete in sites/all/modules/ulmus/entity/includes/entity.controller.inc
Implements EntityAPIControllerInterface.
field_attach_delete in 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 modules/field/field.crud.inc
Purges the field data for a single field on a single pseudo-entity.
node_delete_multiple in modules/node/node.module
Deletes multiple nodes.
node_delete_multiple in modules/node/node.module
Deletes multiple nodes.

File

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

Code

function hook_node_delete($node) {
  db_delete('mytable')->condition('nid', $node->nid)->execute();
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.