Skip to content

Instantly share code, notes, and snippets.

@fago
Created February 17, 2010 16:48
Show Gist options
  • Save fago/306794 to your computer and use it in GitHub Desktop.
Save fago/306794 to your computer and use it in GitHub Desktop.
reaction rule
$rule = rules_reaction_rule();
$rule->event('node_insert')
->condition(rules_or()->condition(rules_and()))
->condition(rules_condition('data_is', array('data:select' => 'node:status', 'value' => TRUE))->negate())
->condition('data_is', array('data:select' => 'node:type', 'op' => 'IN', 'value' => array('page', 'story')))
->condition('data_is', array('data:select' => 'node:type', 'op' => 'IN', 'value' => array('page', 'story')));
$rule->save('test');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment