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;
}
精彩评论