Skip to content

Instantly share code, notes, and snippets.

@henrytran9x
Created March 27, 2015 02:22
Show Gist options
  • Save henrytran9x/c50d56c5536414765234 to your computer and use it in GitHub Desktop.
Save henrytran9x/c50d56c5536414765234 to your computer and use it in GitHub Desktop.
Write module used hook_cron process delele node content type !
function MYMODULE_cron() {
$query = new EntityFieldQuery;
$result = $query->entityCondition('entity_type', 'node')
->propertyCondition('type', 'YOUR-CONTENT-TYPE')
->execute();
if (isset($result['node']) && count($result['node'])) {
$node_ids = array_keys($result['node']);
node_delete_multiple($node_ids);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment