function module_invoke_all

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 module.inc module_invoke_all($hook)
cle7 module.inc module_invoke_all($hook)
elmsmedia7 module.inc module_invoke_all($hook)
icor7 module.inc module_invoke_all($hook)
meedjum_blog7 module.inc module_invoke_all($hook)
mooc7 module.inc module_invoke_all($hook)

Invokes a hook in all enabled modules that implement it.

All arguments are passed by value. Use drupal_alter() if you need to pass arguments by reference.

Parameters

$hook: The name of the hook to invoke.

...: Arguments to pass to the hook.

Return value

An array of return values of the hook implementations. If modules return arrays from their implementations, those are merged into one array.

See also

drupal_alter()

Related topics

303 calls to module_invoke_all()
accessibility_accessibility_tests in sites/all/modules/ulmus/accessibility/accessibility.module
Implements hook_accessibility_tests().
accessibility_load in sites/all/modules/ulmus/accessibility/accessibility.module
Helper function to load the QUAIL library.
accessibility_testswarm_testswarm_tests in sites/all/modules/ulmus/accessibility/modules/accessibility_testswarm/accessibility_testswarm.module
Implements hook_testswarm_tests();
accessibility_tests_json in sites/all/modules/ulmus/accessibility/accessibility.pages.inc
Outputs settings and test information in JSON.
accessibility_tests_list in sites/all/modules/ulmus/accessibility/accessibility.admin.inc
Form for importing tests.

... See full list

File

includes/module.inc, line 887
API for loading and interacting with Drupal modules.

Code

function module_invoke_all($hook) {
  $args = func_get_args();
  // Remove $hook from the arguments.
  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)) {
        $return = array_merge_recursive($return, $result);
      }
      elseif (isset($result)) {
        $return[] = $result;
      }
    }
  }

  return $return;
}