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

▾ 121 functions call module_invoke_all()

actions_delete in includes/actions.inc
Deletes a single action from the database.
actions_list in includes/actions.inc
Discovers all available actions by invoking hook_action_info().
aggregator_remove in modules/aggregator/aggregator.module
Removes all items from a feed.
archiver_get_info in includes/common.inc
Retrieve a list of all available archivers.
comment_admin_overview_submit in modules/comment/comment.admin.inc
Process comment_admin_overview form submissions.
comment_build_content in modules/comment/comment.module
Builds a structured array representing the comment's content.
comment_delete_multiple in modules/comment/comment.module
Delete comments and all their replies.
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
dashboard_region_descriptions in modules/dashboard/dashboard.module
Return an array of dashboard region descriptions, keyed by region name.
default_install in profiles/default/default.install
Implement hook_install().
drupal_cron_run in includes/common.inc
Executes a cron run when called.
drupal_exit in includes/common.inc
Perform end-of-request tasks.
drupal_flush_all_caches in includes/common.inc
Flush all cached data on the site.
drupal_get_rdf_namespaces in includes/common.inc
Return a string containing RDF namespaces for the <html> tag of an XHTML page.
drupal_get_updaters in includes/common.inc
Drupal Updater registry.
drupal_language_initialize in includes/bootstrap.inc
Initialize all the defined language types.
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.
drupal_uninstall_modules in includes/install.inc
Calls the uninstall function and updates the system table for a given module.
element_info in includes/common.inc
Retrieve the default properties for the defined element type.
entity_get_info in includes/common.inc
Get the entity info array of an entity type.
field_access in modules/field/field.module
Determine whether the user has access to a given field.
field_build_modes in modules/field/field.module
Registry of available build modes.
field_create_field in modules/field/field.crud.inc
Create a field.
field_create_instance in modules/field/field.crud.inc
Creates an instance of a field, binding it to a bundle.
field_delete_field in modules/field/field.crud.inc
Mark a field for deletion, including all its instances and all data associated with it.
field_delete_instance in modules/field/field.crud.inc
Mark a field instance for deletion, including all data associated with it.
field_extra_fields in modules/field/field.module
Registry of pseudo-field components in a given bundle.
field_purge_field in modules/field/field.crud.inc
Purge a field record from the database.
field_purge_instance in modules/field/field.crud.inc
Purge a field instance record from the database.
field_read_fields in modules/field/field.crud.inc
Read in fields that match an array of conditions.
field_read_instances in modules/field/field.crud.inc
Read in field instances that match an array of conditions.
field_ui_build_modes_tabs in modules/field_ui/field_ui.module
Group available build modes on tabs on the 'Manage display' page.
file_copy in includes/file.inc
Copy a file to a new location and adds a file record to the database.
file_delete in includes/file.inc
Delete a file and its database record.
file_download in includes/file.inc
Menu handler for private file transfers.
file_get_stream_wrappers in includes/file.inc
Drupal stream wrapper registry.
file_managed_file_validate in modules/file/file.module
An #element_validate callback for the managed_file element.
file_move in includes/file.inc
Move a file to a new location and update the file's database entry.
file_save in includes/file.inc
Save a file object to the database.
file_validate in includes/file.inc
Check that a file meets the criteria specified by the validators.
filter_format_delete in modules/filter/filter.module
Delete a text format.
filter_format_save in modules/filter/filter.module
Save a text format object to the database.
hook_search_admin in modules/search/search.api.php
Add elements to the search administration form.
hook_search_execute in modules/search/search.api.php
Execute a search for a set of key words.
hook_update_index in modules/search/search.api.php
Update Drupal's full-text index for this module.
image_file_download in modules/image/image.module
Implement hook_file_download().
image_get_available_toolkits in includes/image.inc
Return a list of available toolkits.
image_style_delete in modules/image/image.module
Delete an image style.
image_style_flush in modules/image/image.module
Flush cached media for a style.
image_style_save in modules/image/image.module
Save an image style.
language_negotiation_info in includes/language.inc
Return all the defined language providers.
language_types_info in includes/language.inc
Return all the defined language types.
locale_languages_delete_form_submit in includes/locale.inc
Process language deletion submissions.
locale_languages_overview_form_submit in includes/locale.inc
Process language overview form submissions, updating existing languages.
locale_languages_predefined_form_submit in includes/locale.inc
Process the language addition form submission.
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_translation_filters in includes/locale.inc
List locale translation filters that can be applied.
menu_delete in modules/menu/menu.module
Delete a custom menu and all contained links.
menu_link_save in includes/menu.inc
Save a menu link.
menu_save in modules/menu/menu.module
Save a custom menu.
module_disable in includes/module.inc
Disable a given set of modules.
module_enable in includes/module.inc
Enable a given list of modules.
node_access in modules/node/node.module
Determine whether the current user may perform the given operation on the specified node.
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_build_content in modules/node/node.module
Builds a structured array representing the node's content.
node_delete_multiple in modules/node/node.module
Delete multiple nodes.
node_object_prepare in modules/node/node.pages.inc
node_revision_delete in modules/node/node.module
Delete a node revision.
node_save in modules/node/node.module
Save changes to a node or add a new node.
node_search_admin in modules/node/node.module
Implement hook_search_admin().
node_search_execute in modules/node/node.module
Implement hook_search_execute().
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_validate in modules/node/node.module
Perform validation checks on the given node.
path_delete in includes/path.inc
Delete a URL alias.
path_save in includes/path.inc
Save a path alias to the database.
search_reindex in modules/search/search.module
Wipes a part of or the entire search index.
shortcut_default_set in modules/shortcut/shortcut.module
Returns the default shortcut set for a given user account.
simpletest_run_tests in modules/simpletest/simpletest.module
Actually runs tests.
system_authorized_init in modules/system/system.module
Setup a given callback to run via authorize.php with elevated privileges.
system_cron in modules/system/system.module
Implement hook_cron().
system_get_filetransfer_settings_form in modules/system/system.module
Helper function to return a form for configuring a filetransfer backend.
system_status in modules/system/system.admin.inc
Menu callback: displays the site status report. Can also be used as a pure check.
taxonomy_term_delete in modules/taxonomy/taxonomy.module
Delete a term.
taxonomy_term_save in modules/taxonomy/taxonomy.module
Save a term object to the database.
taxonomy_vocabulary_delete in modules/taxonomy/taxonomy.module
Delete a vocabulary.
taxonomy_vocabulary_save in modules/taxonomy/taxonomy.module
Save a vocabulary given a vocabulary object.
token_generate in includes/token.inc
Generate replacement values for a list of tokens.
token_info in includes/token.inc
Returns metadata describing supported tokens.
translation_node_prepare in modules/translation/translation.module
Implement hook_node_prepare().
trigger_assign in modules/trigger/trigger.admin.inc
Builds the form that allows users to assign actions to triggers.
trigger_example_ping in developer/examples/trigger_example.module
Function to generate ping events and invoke hook_trigger_example().
trigger_example_pong in developer/examples/trigger_example.module
Function to generate pong events and invoke hook_trigger_example().
trigger_menu in modules/trigger/trigger.module
Implement hook_menu().
update_manager_archive_verify in modules/update/update.manager.inc
Verify an archive after it has been downloaded and extracted.
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.
user_build_content in modules/user/user.module
Builds a structured array representing the profile content.
user_cancel in modules/user/user.module
Cancel a user account.
user_logout in modules/user/user.pages.inc
Menu callback; logs the current user out, and redirects to the home page.
user_role_delete in modules/user/user.module
Delete a user role from database.
user_role_save in modules/user/user.module
Save a user role to the database.
_drupal_bootstrap_full in includes/common.inc
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table
_menu_delete_item in includes/menu.inc
Helper function for menu_link_delete; deletes a single menu link.
_node_index_node in modules/node/node.module
Index a single node.
_node_rankings in modules/node/node.module
Gather the rankings from the the hook_ranking implementations.
_node_types_build in modules/node/node.module
Builds and returns the list of available node types.
_simpletest_batch_finished in modules/simpletest/simpletest.module
_simpletest_batch_operation in modules/simpletest/simpletest.module
Batch operation callback.
_system_date_formats_build in modules/system/system.module
Builds and returns the list of available date formats.
_trigger_get_all_info in modules/trigger/trigger.module
Retrieves and caches information from hook_trigger_info() implementations.
_user_categories in modules/user/user.module
Retrieve a list of all user setting/information categories and sort them by weight.

Code

includes/module.inc, line 522

<?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;
    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;
}
?>
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.