You are here

function variable_invoke_all in Variable 7.2

Same name and namespace in other branches
  1. 7 variable.inc \variable_invoke_all()

Invoke hook on all modules, adding 'module' property

1 call to variable_invoke_all()
variable_build_info in ./variable.inc
Build generic variable information

File

./variable.module, line 819
Variable API module

Code

function variable_invoke_all() {
  $args = func_get_args();
  $hook = $args[0];
  unset($args[0]);
  $return = array();
  foreach (module_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    if (function_exists($function)) {
      $result = call_user_func_array($function, $args);
      if (isset($result) && is_array($result)) {
        foreach ($result as $key => $value) {
          $return[$key] = $value + array(
            'module' => $module,
          );
        }
      }
    }
  }
  return $return;
}