JoeMH
JoeMH

Reputation: 21

How to Schedule Component using PHP in Drupal Rules

I'm looking to "Schedule a Component" in Rules using some PHP. I'm able to set a value using "values known by the strtotime() function. Like +1 day.", but I would really like to use PHP to set the value (I'm wanting to set the scheduled date to a value in another field). I understand that there is a "PHP Evaluation" area when I switch to "Data Selection" mode, but am unable to write any PHP that will work with it.

Do you have any idea?

Upvotes: 0

Views: 690

Answers (1)

scronide
scronide

Reputation: 12238

The PHP Evaluation for Scheduled Evaluation Date expects you to return a timestamp without PHP delimiters. For example:

return strtotime('2001-03-10 17:16:18');

Note that any time in the past will trigger the rule on the next cron run.

Upvotes: 0

Related Questions