You are here

function module_hook in Drupal 5

Same name and namespace in other branches
  1. 4 includes/module.inc \module_hook()
  2. 6 includes/module.inc \module_hook()
  3. 7 includes/module.inc \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 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.

... See full list

File

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

Code

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