function module_invoke

Invokes a hook in a particular module.

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()->invoke($module, $hook, $args = array()).

See also

drupal_alter()

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

46 calls to module_invoke()
bootstrap_invoke_all in drupal/core/includes/bootstrap.inc
Invokes a bootstrap hook in all bootstrap modules that implement it.
comment_admin_overview in drupal/core/modules/comment/comment.admin.inc
Form constructor for the comment overview administration form.
CustomBlockFormController::form in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
Overrides \Drupal\Core\Entity\EntityFormController::form().
drupal_check_module in drupal/core/includes/install.inc
Checks a module's requirements.
drupal_cron_run in drupal/core/includes/common.inc
Executes a cron run when called.

... See full list

File

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

Code

function module_invoke($module, $hook) {
  $args = func_get_args();

  // Remove $module and $hook from the arguments.
  unset($args[0], $args[1]);
  return Drupal::moduleHandler()
    ->invoke($module, $hook, $args);
}