function module_invoke_all

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.

Deprecated

as of Drupal 8.0. Use Drupal::moduleHandler()->invokeAll($hook).

See also

drupal_alter()

\Drupal\Core\Extension\ModuleHandler::invokeAll()

86 calls to module_invoke_all()
AdminTest::setUp in drupal/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
Sets up a Drupal site for running functional and integration tests.
BreadcrumbTest::setUp in drupal/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
Sets up a Drupal site for running functional and integration tests.
CommentStorageController::postSave in drupal/core/modules/comment/lib/Drupal/comment/CommentStorageController.php
Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
ConfigStorageController::invokeHook in drupal/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
Invokes a hook on behalf of the entity.
CustomBlockFormController::prepareEntity in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
Overrides \Drupal\Core\Entity\EntityFormController::prepareEntity().

... See full list

File

drupal/core/includes/bootstrap.inc, line 2215
Functions that need to be loaded on every Drupal request.

Code

function module_invoke_all($hook) {
  $args = func_get_args();

  // Remove $hook from the arguments.
  array_shift($args);
  return Drupal::moduleHandler()
    ->invokeAll($hook, $args);
}