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

▾ 17 functions call module_hook()

form_textarea in includes/common.inc
Format a multiple-line text field.
help_links_as_list in modules/help.module
help_menu in modules/help.module
Implementation of hook_menu().
help_page in modules/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.
node_list in modules/node.module
Get a list of all the defined node types.
search_admin in modules/search.module
Menu callback; displays the search module settings page.
search_data in modules/search.module
Perform a standard search on the given keys, and return the formatted results.
search_menu in modules/search.module
Implementation of hook_menu().
system_menu in modules/system.module
Implementation of hook_menu().
system_module_listing in modules/system.module
Generate a list of all the available modules, as well as update the system list.
theme_search_item in modules/search.module
Format a single result entry of a search query.
user_authenticate in modules/user.module
user_auth_help_links in modules/user.module
user_help in modules/user.module
Implementation of hook_help().

Code

includes/module.inc, line 135

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