You are here

function workbench_moderation_set_state_rules_action in Workbench Moderation 7.3

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

Action: Change the moderation state of a given node.

$param $node A node object

$param $moderation_state The desired moderation state to assign.

$param $force_transition If set to TRUE, then the transition change will be allowed regardless of permissions and allowed transition flow. If set to FALSE, then the transition only changes if all transition change requirements are met.

Return value

An array containing the node object stored in the key called 'node'.

1 string reference to 'workbench_moderation_set_state_rules_action'
workbench_moderation_rules_action_info in ./workbench_moderation.rules.inc
Implements hook_rules_action_info() on behalf of the workbench_moderation module.

File

./workbench_moderation.rules.inc, line 303

Code

function workbench_moderation_set_state_rules_action($node, $moderation_state, $force_transition) {
  if (is_object($node) && !empty($moderation_state)) {
    actions_do('workbench_moderation_set_state_action', $node, array(
      'state' => $moderation_state,
      'force_transition' => $force_transition,
    ));
  }
  return array(
    'node' => $node,
  );
}