You are here

function _feedapi_node_node_delete in FeedAPI 5

Same name and namespace in other branches
  1. 6 feedapi_node/feedapi_node.module \_feedapi_node_node_delete()

Copy of http://api.drupal.org/api/function/node_delete/6 to avoid permission checking

@todo: this is just a workaround to be able to delete nodes at cron time

Parameters

unknown_type $nid:

1 call to _feedapi_node_node_delete()
_feedapi_node_delete in feedapi_node/feedapi_node.module
Delete a node which already assigned to a feed item

File

feedapi_node/feedapi_node.module, line 433
Handle how the feed items are represented as a content Handle the processing of the feed items

Code

function _feedapi_node_node_delete($nid) {
  $node = node_load($nid);
  db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
  db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);

  // Call the node-specific callback (if any):
  node_invoke($node, 'delete');
  node_invoke_nodeapi($node, 'delete');

  // Clear the page and block caches.
  cache_clear_all();

  // Remove this node from the search index if needed.
  if (function_exists('search_wipe')) {
    search_wipe($node->nid, 'node');
  }
  drupal_set_message(t('%title has been deleted.', array(
    '%title' => $node->title,
  )));
  watchdog('content', t('@type: deleted %title.', array(
    '@type' => t($node->type),
    '%title' => $node->title,
  )));
}