You are here

function workbench_moderation_rules_condition_contents_previous_state in Workbench Moderation 7.3

Same name and namespace in other branches
  1. 7 workbench_moderation.rules.inc \workbench_moderation_rules_condition_contents_previous_state()

Condition: Check if workbench moderation previous state matched selected state.

Parameters

$node: A node object

$moderation_state: The desired moderation state to compare with

Return value

TRUE/FALSE depending on if the nodes previous state matches selected state.

1 string reference to 'workbench_moderation_rules_condition_contents_previous_state'
workbench_moderation_rules_condition_info in ./workbench_moderation.rules.inc
Implements hook_rules_condition_info().

File

./workbench_moderation.rules.inc, line 275

Code

function workbench_moderation_rules_condition_contents_previous_state($node, $moderation_state) {
  if (!is_object($node)) {
    return FALSE;
  }
  if ($node->workbench_moderation['current']->from_state != $moderation_state) {
    return FALSE;
  }
  return TRUE;
}