Created
March 27, 2015 02:22
-
-
Save henrytran9x/c50d56c5536414765234 to your computer and use it in GitHub Desktop.
Write module used hook_cron process delele node content type !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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