module_invoke_all

Versions
4.6 – 7
module_invoke_all()

Invoke a hook in all enabled modules that implement it.

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.

Related topics

▾ 44 functions call module_invoke_all()

actions_delete in includes/actions.inc
Delete a single action from the database.
actions_list in includes/actions.inc
Discover all action functions by invoking hook_action_info().
comment_render in modules/comment/comment.module
Renders comment(s).
drupal_cron_run in includes/common.inc
Executes a cron run when called
drupal_flush_all_caches in includes/common.inc
Flush all cached data on the site.
drupal_goto in includes/common.inc
Send the user to a different Drupal page.
drupal_page_footer in includes/common.inc
Perform end-of-request tasks.
drupal_retrieve_form in includes/form.inc
Retrieves the structured array that defines a given form.
file_download in includes/file.inc
Call modules that implement hook_file_download() to find out if a file is accessible and what headers it should be transferred with. If a module returns -1 drupal_access_denied() will be returned. If one or more modules returned headers the download...
locale_translate_export_pot_form in includes/locale.inc
Translation template export form.
locale_translate_export_po_form in includes/locale.inc
Form to export PO files for the languages provided.
locale_translate_import_form in includes/locale.inc
User interface for the translation import screen.
locale_translate_overview_screen in includes/locale.inc
Overview screen for translations.
locale_translate_seek_form in includes/locale.inc
User interface for the string search screen.
node_access_acquire_grants in modules/node/node.module
This function will call module invoke to get a list of grants and then write them to the database. It is called at node save, and should be called by modules whenever something other than a node_save causes the permissions on a node to change.
node_access_grants in modules/node/node.module
Fetch an array of permission IDs granted to the given user ID.
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_admin_nodes_submit in modules/node/node.admin.inc
Process node_admin_nodes form submissions.
node_type_delete in modules/node/node.module
Deletes a node type from the database.
node_type_reset in modules/node/content_types.inc
Resets all of the relevant fields of a module-defined node type to their default values.
node_type_save in modules/node/node.module
Saves a node type to the database.
node_view in modules/node/node.module
Generate a display of the given node.
openid_authentication_request in modules/openid/openid.module
poll_view in modules/poll/poll.module
Implementation of hook_view().
search_admin_settings in modules/search/search.admin.inc
Menu callback; displays the search module settings page.
search_wipe in modules/search/search.module
Wipes a part of or the entire search index.
system_cron in modules/system/system.module
Implementation of hook_cron().
system_status in modules/system/system.admin.inc
Menu callback: displays the site status report. Can also be used as a pure check.
taxonomy_del_term in modules/taxonomy/taxonomy.module
Delete a term.
taxonomy_del_vocabulary in modules/taxonomy/taxonomy.module
Delete a vocabulary.
taxonomy_save_term in modules/taxonomy/taxonomy.module
Helper function for taxonomy_form_term_submit().
taxonomy_save_vocabulary in modules/taxonomy/taxonomy.module
theme_closure in includes/theme.inc
Execute hook_footer() which is run at the end of the page right before the close of the body tag.
theme_comment_flat_expanded in modules/comment/comment.module
Theme comment flat expanded view.
theme_comment_thread_expanded in modules/comment/comment.module
Theme comment thread expanded view.
trigger_assign in modules/trigger/trigger.admin.inc
Build the form that allows users to assign actions to hooks.
trigger_forms in modules/trigger/trigger.module
Implementation of hook_forms(). We reuse code by using the same assignment form definition for each node-op combination.
trigger_menu in modules/trigger/trigger.module
Implementation of hook_menu().
user_admin_account in modules/user/user.admin.inc
Form builder; User administration page.
user_admin_account_submit in modules/user/user.admin.inc
Submit the user administration update form.
_drupal_bootstrap_full in includes/common.inc
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table
_node_types_build in modules/node/node.module
Builds and returns the list of available node types.
_ping_notify in modules/ping/ping.module
Call hook_ping() in all modules to notify remote sites that there is new content at this one.

Code

includes/module.inc, line 475

<?php
function module_invoke_all() {
  $args = func_get_args();
  $hook = $args[0];
  unset($args[0]);
  $return = array();
  foreach (module_implements($hook) as $module) {
    $function = $module .'_'. $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }

  return $return;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.