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/
cis7 module_invoke_all($hook)
cle7 module_invoke_all($hook)
elmsmedia7 module_invoke_all($hook)
icor7 module_invoke_all($hook)
meedjum_blog7 module_invoke_all($hook)
mooc7 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.


$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


Related topics

322 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/
Outputs settings and test information in JSON.
accessibility_tests_list in sites/all/modules/ulmus/accessibility/
Form for importing tests.

... See full list


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


function module_invoke_all($hook) {
  $args = func_get_args();
  // Remove $hook from the arguments.
  $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;