You are here

function rules_action_callback in Rules 6

The implementation callback for an action.

It should be placed into the file MODULENAME.rules.inc.

Parameters

The callback gets the arguments passed as described in: hook_rules_action_info() as well as an array containing the action's configuration settings, if there are any.

Return value

The action may return an array containg variables and their names as key. This is used to let rules save a variable having a savable data type. Or also, if the action has specified to provide new variables it can do so by returning the variables. For an example adding a new variable see rules_action_load_node().

Conditions have to return a boolean value.

See also

hook_rules_action_info().

Related topics

File

rules/rules.api.php, line 150
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function rules_action_callback($node, $title, $settings) {
  $node->title = $title;
  return array(
    'node' => $node,
  );
}