module_invoke

Definition

module_invoke()
includes/module.inc, line 438

Description

Invoke a hook in a particular module.

Parameters

$module The name of the module (without the .module extension).

$hook The name of the hook to invoke.

... Arguments to pass to the hook implementation.

Return value

The return value of the hook implementation.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function module_invoke() {
  $args = func_get_args();
  $module = $args[0];
  $hook = $args[1];
  unset($args[0], $args[1]);
  if (module_hook($module, $hook)) {
    return call_user_func_array($module . '_' . $hook, $args);
  }
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.