You are here

function node_revision_delete_workbench_moderation_transition in Node Revision Delete 7.2

Implements hook_workbench_moderation_transition().

Delete old revisions directly during moderation transition.

File

./node_revision_delete.module, line 307
Node Revision Delete Module.

Code

function node_revision_delete_workbench_moderation_transition($node, $previous_state, $new_state) {
  $settings = node_revision_delete_content_types();
  if (!empty($settings[$node->type])) {
    $deleted_revisions = _node_revision_delete_do_delete($node->nid, $settings[$node->type]);
    if (!empty($deleted_revisions->count)) {
      drupal_set_message(t('Deleted @total revisions.', array(
        '@total' => $deleted_revisions->count,
      )));
    }
  }
}