function _feeds_node_delete in Feeds 6
Copy of node_delete() that circumvents node_access().
Used for batch deletion.
2 calls to _feeds_node_delete()
- FeedsNodeProcessor::clear in plugins/
FeedsNodeProcessor.inc - Implementation of FeedsProcessor::clear().
- FeedsNodeProcessor::expire in plugins/
FeedsNodeProcessor.inc - Implement expire().
File
- plugins/
FeedsNodeProcessor.inc, line 476 - Class definition of FeedsNodeProcessor.
Code
function _feeds_node_delete($nid) {
if ($node = node_load($nid, NULL, TRUE)) {
db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);
db_query('DELETE FROM {node_access} 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');
}
watchdog('content', '@type: deleted %title.', array(
'@type' => $node->type,
'%title' => $node->title,
));
drupal_set_message(t('@type %title has been deleted.', array(
'@type' => node_get_types('name', $node),
'%title' => $node->title,
)));
}
}