开发者

How to get Drupal Rules settings?

How to programmatically retrieve configuration of the specific rule?

I tried

$settings = rules_config_load('RULE_NAME');

It returns very basic info (name, ID etc) and empty "settings" array.

开发者_开发技巧Cant also get it directly from DB .

It is stored in serialized array that can not be fully processed with the unserialize() function


I got the same issue and end up here, here is a solution i found, you need to call actions() on your rule to access settings:

$rule = rules_config_load('RULE_NAME');
foreach ($rule->actions() as $action) {
  $settings[] = $action->settings;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜