Drupal – Enable Custom PHP Code Condition for Rules

Last time i have shown you the basic usage of the Rules module.
Drupal – Build Simple Workflow with Rules

Whenever a rule is fired, you can add some conditions to validate if the actions should be run. And you can even setup a PHP code condition for rule. But this feature required the PHP Filter in the Drupal Core modules.

 

Let’s recall the Log a new user rule in Drupal – Build Simple Workflow with Rules. Now we can add a Custom PHP Code condition. The following code will never fire the action since it will return false. but it will log the user information to watchdog.

 

Register a new user and see what we got this time.

 

Done =)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.