You are here

function feeds_node_delete in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 feeds.module \feeds_node_delete()
  2. 7 feeds.module \feeds_node_delete()

Implements hook_node_delete().

Related topics

File

./feeds.module, line 796
Feeds - basic API functions and hook implementations.

Code

function feeds_node_delete($node) {

  // Source attached to node.
  // Make sure we don't leave any orphans behind: Do not use
  // feeds_get_importer_id() to determine importer id as the importer may have
  // been deleted.
  if ($importer_id = db_query("SELECT id FROM {feeds_source} WHERE feed_nid = :nid", array(
    ':nid' => $node->nid,
  ))
    ->fetchField()) {
    feeds_source($importer_id, $node->nid)
      ->delete();
  }
}