module_hook

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 8 module_hook($module, $hook)

Determine whether a module implements a hook.

Parameters

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

$hook The name of the hook (e.g. "help" or "menu").

Return value

TRUE if the module is both installed and enabled, and the hook is implemented in that module.

Related topics

▾ 13 functions call module_hook()

drupal_check_profile in includes/install.inc
Check a profile's requirements.
help_page in modules/help/help.module
Menu callback; prints a page listing general help for all modules.
menu_get_active_help in includes/menu.inc
Returns the help associated with the active menu item.
module_implements in includes/module.inc
Determine which modules are implementing a hook.
module_invoke in includes/module.inc
Invoke a hook in a particular module.
module_rebuild_cache in includes/module.inc
Rebuild the database cache of module files.
node_hook in modules/node/node.module
Determine whether a node hook exists.
search_admin_settings in modules/search/search.module
Menu callback; displays the search module settings page.
search_data in modules/search/search.module
Perform a standard search on the given keys, and return the formatted results.
search_menu in modules/search/search.module
Implementation of hook_menu().
system_get_module_admin_tasks in modules/system/system.module
system_modules_uninstall in modules/system/system.module
Builds a form of currently disabled modules.
user_help in modules/user/user.module
Implementation of hook_help().

Code

includes/module.inc, line 321

<?php
function module_hook($module, $hook) {
  return function_exists($module . '_' . $hook);
}
?>