function hook_rules_condition_info
Define rules conditions.
This hook is required in order to add a new rules condition. It should be placed into the file MODULENAME.rules.inc, which gets automatically included when the hook is invoked.
However, as an alternative to implementing this hook, class based plugin handlers may be provided by implementing RulesConditionHandlerInterface. See the interface for details.
Adding conditions works exactly the same way as adding actions, with the exception that conditions can't provide variables and cannot save parameters. Thus the 'provides' attribute is not supported. Furthermore the condition implementation callback has to return a boolean value.
See also
Related topics
2 functions implement hook_rules_condition_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- rules_rules_condition_info in ./
rules.rules.inc - Implements hook_rules_condition_info().
- rules_test_rules_condition_info in tests/
rules_test.rules.inc - Implements hook_rules_condition_info().
File
-
./
rules.api.php, line 297
Code
function hook_rules_condition_info() {
return array(
'rules_condition_text_compare' => array(
'label' => t('Textual comparison'),
'parameter' => array(
'text1' => array(
'label' => t('Text 1'),
'type' => 'text',
),
'text2' => array(
'label' => t('Text 2'),
'type' => 'text',
),
),
'group' => t('Rules'),
),
);
}