4.6.x module.inc module_invoke()
4.7.x module.inc module_invoke()
5.x module.inc module_invoke()
6.x module.inc module_invoke()
7.x module.inc module_invoke($module, $hook)

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

34 calls to module_invoke()
block_list in modules/block.module
Return all blocks in the specied region for the current user. You may use this function to implement variable block regions. The default regions are 'left', 'right' and 'all', where 'all' means both left and right.
blogapi_blogger_edit_post in modules/blogapi.module
Blogging API callback. Modifies the specified blog node.
blogapi_metaweblog_get_category_list in modules/blogapi.module
Blogging API callback. Returns a list of the taxonomy terms that can be associated with a blog node.
blogapi_mt_get_post_categories in modules/blogapi.module
Blogging API callback. Returns a list of the taxonomy terms that are assigned to a particular node.
blogapi_mt_set_post_categories in modules/blogapi.module
Blogging API callback. Assigns taxonomy terms to a particular node.

... See full list

File

includes/module.inc, line 175
API for loading and interacting with Drupal modules.

Code

function module_invoke() {
  $args = func_get_args();
  $module = array_shift($args);
  $hook = array_shift($args);
  $function = $module . '_' . $hook;
  if (module_hook($module, $hook)) {
    return call_user_func_array($function, $args);
  }
}