1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
5 – 6 module_invoke_all()
8 – 7 module_invoke_all($hook)

Invoke a hook in all enabled modules that implement it.


$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

▾ 143 functions call module_invoke_all()

actions_delete in includes/
Deletes a single action from the database.
actions_list in includes/
Discovers all available actions by invoking hook_action_info().
aggregator_remove in modules/aggregator/aggregator.module
Removes all items from a feed.
ajax_footer in includes/
Perform end-of-Ajax-request tasks.
archiver_get_info in includes/
Retrieves a list of all available archivers.
CacheClearCase::testFlushAllCaches in modules/simpletest/tests/cache.test
Test drupal_flush_all_caches().
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.
DrupalWebTestCase::checkPermissions in modules/simpletest/drupal_web_test_case.php
Check to make sure that the array of permissions are valid.
drupal_cron_run in includes/
Executes a cron run when called.
drupal_exit in includes/
Perform end-of-request tasks.
drupal_flush_all_caches in includes/
Flush all cached data on the site.
drupal_get_updaters in includes/
Drupal Updater registry.
drupal_page_footer in includes/
Perform end-of-request tasks.
drupal_retrieve_form in includes/
Retrieves the structured array that defines a given form.
drupal_uninstall_modules in includes/
Uninstalls a given list of modules.
element_info in includes/
Retrieve the default properties for the defined element type.
entity_get_info in includes/
Get the entity info array of an entity type.
entity_prepare_view in includes/
Invoke hook_entity_prepare_view().
field_attach_create_bundle in modules/field/
Notify field.module that a new bundle was created.
field_attach_delete in modules/field/
Delete field data for an existing entity. This deletes all revisions of field data for the entity.
field_attach_delete_bundle in modules/field/
Notify field.module the a bundle was deleted.
field_attach_delete_revision in modules/field/
Delete field data for a single revision of an existing entity. The passed entity must have a revision id attribute.
field_attach_insert in modules/field/
Save field data for a new entity.
field_attach_load in modules/field/
Loads fields for the current revisions of a group of entities.
field_attach_presave in modules/field/
Perform necessary operations just before fields data get saved.
field_attach_rename_bundle in modules/field/
Notify field.module that a bundle was renamed.
field_attach_update in modules/field/
Save field data for an existing entity.
field_create_field in modules/field/
Creates a field.
field_create_instance in modules/field/
Creates an instance of a field, binding it to a bundle.
field_delete_field in modules/field/
Marks a field and its instances and data for deletion.
field_delete_instance in modules/field/
Marks a field instance and its data for deletion.
field_info_max_weight in modules/field/
Returns the maximum weight of all the components in an entity.
field_purge_field in modules/field/
Purges a field record from the database.
field_purge_instance in modules/field/
Purges a field instance record from the database.
field_read_fields in modules/field/
Reads in fields that match an array of conditions.
field_read_instances in modules/field/
Reads in field instances that match an array of conditions.
field_update_field in modules/field/
Updates a field.
field_update_instance in modules/field/
Updates an instance of a field.
file_copy in includes/
Copies a file to a new location and adds a file record to the database.
file_delete in includes/
Delete a file and its database record.
file_get_stream_wrappers in includes/
Drupal stream wrapper registry.
file_move in includes/
Move a file to a new location and update the file's database entry.
file_save in includes/
Save a file object to the database.
file_validate in includes/
Check that a file meets the criteria specified by the validators.
filter_format_disable in modules/filter/filter.module
Disable 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 settings 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 the search index for this module.
image_file_download in modules/image/image.module
Implements hook_file_download().
image_get_available_toolkits in includes/
Return a list of available toolkits.
image_style_delete in modules/image/image.module
Delete an image style.
image_style_deliver in modules/image/image.module
Menu callback; Given a style and image path, generate a derivative.
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/
Return all the defined language providers.
language_types_info in includes/
Return all the defined language types.
locale_add_language in includes/
API function to add a language.
locale_languages_delete_form_submit in modules/locale/
Process language deletion submissions.
locale_languages_overview_form_submit in modules/locale/
Process language overview form submissions, updating existing languages.
locale_translate_export_pot_form in modules/locale/
Translation template export form.
locale_translate_export_po_form in modules/locale/
Form to export PO files for the languages provided.
locale_translate_import_form in modules/locale/
User interface for the translation import screen.
locale_translate_overview_screen in modules/locale/
Overview screen for translations.
locale_translation_filters in modules/locale/
List locale translation filters that can be applied.
MenuBreadcrumbTestCase::setUp in modules/simpletest/tests/menu.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
menu_delete in modules/menu/menu.module
Delete a custom menu and all contained links.
menu_get_custom_theme in includes/
Gets the custom theme for the current page, if there is one.
menu_link_save in includes/
Saves a menu link.
menu_save in modules/menu/menu.module
Save a custom menu.
module_disable in includes/
Disable a given set of modules.
module_enable in includes/
Enables or installs a given list of modules.
module_test_hook_dynamic_loading_invoke_all in modules/simpletest/tests/module_test.module
Page callback for 'hook dynamic loading' test.
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
Gets the list of node access grants and writes them to the database.
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/
Form builder: Builds the node administration overview.
node_admin_nodes_submit in modules/node/
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.module
Prepares a node object for editing.
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
Implements hook_search_admin().
node_search_execute in modules/node/node.module
Implements hook_search_execute().
node_type_delete in modules/node/node.module
Deletes a node type from the database.
node_type_reset in modules/node/
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.
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
openid_authentication_request in modules/openid/openid.module
openid_discovery in modules/openid/openid.module
Perform discovery on a claimed ID to determine the OpenID provider endpoint.
openid_normalize in modules/openid/
Normalize the given identifier.
overlay_set_mode in modules/overlay/overlay.module
Sets the overlay mode and adds proper JavaScript and styles to the page.
path_delete in includes/
Delete a URL alias.
path_get_admin_paths in includes/
Get a list of administrative and non-administrative paths.
path_save in includes/
Save a path alias to the database.
rdf_get_namespaces in modules/rdf/rdf.module
Returns an array of RDF namespaces defined in modules that implement hook_rdf_namespaces().
SearchExactTestCase::testExactQuery in modules/search/search.test
Tests that the correct number of pager links are found for both keywords and phrases.
SearchNodeAccessTest::testPhraseSearchPunctuation in modules/search/search.test
Tests that search returns results with punctuation in the search phrase.
SearchRankingTestCase::testDoubleRankings in modules/search/search.test
Verifies that if we combine two rankings, search still works.
SearchRankingTestCase::testHTMLRankings in modules/search/search.test
Test rankings of HTML tags.
SearchRankingTestCase::testRankings in modules/search/search.test
search_reindex in modules/search/search.module
Clears 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.
standard_install in profiles/standard/standard.install
Implements hook_install().
SystemAdminTestCase::setUp in modules/system/system.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
system_cron in modules/system/system.module
Implements hook_cron().
system_status in modules/system/
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
Saves 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
Saves a vocabulary.
theme_disable in includes/
Disable a given list of themes.
theme_enable in includes/
Enable a given list of themes.
token_generate in includes/
Generates replacement values for a list of tokens.
token_info in includes/
Returns metadata describing supported tokens.
trigger_assign in modules/trigger/
Builds the form that allows users to assign actions to triggers.
update_check_requirements in ./update.php
Check update requirements and report any errors.
update_manager_archive_verify in modules/update/
Verify an archive after it has been downloaded and extracted.
user_admin_account in modules/user/
Form builder; User administration page.
user_admin_account_submit in modules/user/
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_delete_multiple in modules/user/user.module
Delete multiple user accounts.
user_logout in modules/user/
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.
user_save in modules/user/user.module
Save changes to a user account or add a new user.
_drupal_bootstrap_full in includes/
_field_info_collate_fields in modules/field/
Collates all information on existing fields and instances.
_locale_translate_seek in includes/
Perform a string search and display results in a table
_menu_delete_item in includes/
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.
_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 information about 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.


includes/, line 810

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;