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.


$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.

See also


Related topics

69 calls to module_invoke()
aggregator_admin_form in modules/aggregator/
Form constructor for the aggregator system settings.
aggregator_form_aggregator_admin_form_alter in modules/aggregator/
Implements hook_form_aggregator_admin_form_alter().
aggregator_refresh in modules/aggregator/aggregator.module
Checks a news feed for new items.
block_admin_configure in modules/block/
Form constructor for the block configuration form.
block_admin_configure_submit in modules/block/
Form submission handler for block_admin_configure().

... See full list


includes/, line 930


function module_invoke($module, $hook) {
    $args = func_get_args();
    // Remove $module and $hook from the arguments.
    unset($args[0], $args[1]);
    if (module_hook($module, $hook)) {
        return call_user_func_array($module . '_' . $hook, $args);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.