function hook_rules_config_presave

Act on a rules configuration being inserted or updated.

This hook is invoked before the rules configuration is saved to the database.

Parameters

RulesPlugin $config: The rules configuration that is being inserted or updated.

Related topics

File

./rules.api.php, line 803

Code

function hook_rules_config_presave($config) {
  if ($config->id && $config->owner == 'your_module') {
    // Add custom condition.
    $config->condition();
  }
}