function module_hook

7.x module.inc module_hook($module, $hook)
6.x module.inc 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 calls to module_hook()
drupal_check_profile in drupal-6.x/includes/install.inc
Check a profile's requirements.
help_page in drupal-6.x/modules/help/help.admin.inc
Menu callback; prints a page listing general help for a module.
menu_get_active_help in drupal-6.x/includes/menu.inc
Returns the help associated with the active menu item.
module_disable in drupal-6.x/includes/module.inc
Disable a given set of modules.
module_enable in drupal-6.x/includes/module.inc
Enable a given list of modules.

... See full list

File

drupal-6.x/includes/module.inc, line 411
API for loading and interacting with Drupal modules.

Code

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