module_hook

Versions
4.6 – 7
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

▾ 8 functions call module_hook()

help_page in modules/help/help.admin.inc
Menu callback; prints a page listing general help for a module.
module_disable in includes/module.inc
Disable a given set of modules.
module_enable in includes/module.inc
Enable a given list of modules.
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.
node_hook in modules/node/node.module
Determine whether a node hook exists.
search_data in modules/search/search.module
Perform a standard search on the given keys, and return the formatted results.
system_modules_uninstall in modules/system/system.admin.inc
Builds a form of currently disabled modules.

Code

includes/module.inc, line 417

<?php
function module_hook($module, $hook) {
  return function_exists($module . '_' . $hook);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.