function _delete_all_normal in Delete all 6
Same name and namespace in other branches
- 5 delete_all.module \_delete_all_normal()
- 7 delete_all.module \_delete_all_normal()
2 calls to _delete_all_normal()
- delete_all_content_confirm_submit in ./
delete_all.module - delete_all_drush_delete in ./
delete_all.drush.inc - Drush callback to delete content
File
- ./
delete_all.module, line 239
Code
function _delete_all_normal($all, $types) {
if ($all) {
$result = db_query('SELECT nid FROM {node}' . $where);
}
else {
$placeholders = implode(',', array_fill(0, count($types), "'%s'"));
$result = db_query('SELECT nid FROM {node} WHERE type IN (' . $placeholders . ')', $types);
}
$deleted = 0;
while ($data = db_fetch_object($result)) {
set_time_limit(30);
node_delete($data->nid);
$deleted++;
}
return $deleted;
}