Created
May 13, 2016 01:25
-
-
Save ianlintner-wf/e526f29f9e5065fe3239de14a4d4a94c to your computer and use it in GitHub Desktop.
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
<?php | |
function delete_node_revisions_before_timestamp($nid, $timestamp) { | |
$node = node_load($nid); | |
$revisions = node_revision_list($node); | |
dpm($revisions); | |
foreach($revisions as $revision) { | |
if($revision->timestamp < $timestamp) { | |
dpm($revision->vid); | |
node_revision_delete($revision->vid); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment