Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.218
diff -u -p -r1.218 file.inc
--- includes/file.inc	7 Jul 2010 01:10:35 -0000	1.218
+++ includes/file.inc	20 Jul 2010 14:22:40 -0000
@@ -995,6 +995,7 @@ function file_delete(stdClass $file, $fo
 
   // Let other modules clean up any references to the deleted file.
   module_invoke_all('file_delete', $file);
+  module_invoke_all('entity_delete', $file, 'file');
 
   // Make sure the file is deleted before removing its row from the
   // database, so UIs can still find the file in the database.
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.883
diff -u -p -r1.883 comment.module
--- modules/comment/comment.module	23 Jun 2010 02:45:35 -0000	1.883
+++ modules/comment/comment.module	20 Jul 2010 14:22:41 -0000
@@ -1581,6 +1581,7 @@ function comment_delete_multiple($cids) 
     foreach ($comments as $comment) {
       field_attach_delete('comment', $comment);
       module_invoke_all('comment_delete', $comment);
+      module_invoke_all('entity_delete', $comment, 'comment');
 
       // Delete the comment's replies.
       $child_cids = db_query('SELECT cid FROM {comment} WHERE pid = :cid', array(':cid' => $comment->cid))->fetchCol();
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1280
diff -u -p -r1.1280 node.module
--- modules/node/node.module	16 Jul 2010 02:37:06 -0000	1.1280
+++ modules/node/node.module	20 Jul 2010 14:22:44 -0000
@@ -1148,6 +1148,7 @@ function node_delete_multiple($nids) {
       // Call the node-specific callback (if any):
       node_invoke($node, 'delete');
       module_invoke_all('node_delete', $node);
+      module_invoke_all('entity_delete', $node, 'node');
       field_attach_delete('node', $node);
 
       // Remove this node from the search index if needed.
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.179
diff -u -p -r1.179 system.api.php
--- modules/system/system.api.php	10 Jul 2010 01:59:02 -0000	1.179
+++ modules/system/system.api.php	20 Jul 2010 14:22:47 -0000
@@ -281,6 +281,17 @@ function hook_entity_update($entity, $ty
 }
 
 /**
+ * Act on entities when deleted.
+ *
+ * @param $entity
+ *   The entity object.
+ * @param $type
+ *   The type of entity being deleted (i.e. node, user, comment).
+ */
+function hook_entity_delete($entity, $type) {
+}
+
+/**
  * Alter or execute an EntityFieldQuery.
  *
  * @param EntityFieldQuery $query
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.598
diff -u -p -r1.598 taxonomy.module
--- modules/taxonomy/taxonomy.module	14 Jul 2010 20:26:52 -0000	1.598
+++ modules/taxonomy/taxonomy.module	20 Jul 2010 14:22:48 -0000
@@ -424,7 +424,8 @@ function taxonomy_vocabulary_delete($vid
     ->execute();
 
   field_attach_delete_bundle('taxonomy_term', $vocabulary['machine_name']);
-  module_invoke_all('taxonomy', 'delete', 'vocabulary', $vocabulary);
+  module_invoke_all('taxonomy_vocabulary_delete', $vocabulary);
+  module_invoke_all('entity_delete', $vocabulary, 'taxonomy_vocabulary');
 
   cache_clear_all();
   entity_get_controller('taxonomy_vocabulary')->resetCache();
@@ -576,6 +577,7 @@ function taxonomy_term_delete($tid) {
 
       field_attach_delete('taxonomy_term', $term);
       module_invoke_all('taxonomy_term_delete', $term);
+      module_invoke_all('entity_delete', $term, 'taxonomy_term');
     }
 
     $tids = $orphans;
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1182
diff -u -p -r1.1182 user.module
--- modules/user/user.module	20 Jul 2010 10:17:59 -0000	1.1182
+++ modules/user/user.module	20 Jul 2010 14:22:50 -0000
@@ -2337,6 +2337,7 @@ function user_delete_multiple(array $uid
 
     foreach ($accounts as $uid => $account) {
       module_invoke_all('user_delete', $account);
+      module_invoke_all('entity_delete', $account, 'user');
       field_attach_delete('user', $account);
     }
 
