function module_hook


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 module_hook($module, $hook)
cle7 module_hook($module, $hook)
elmsmedia7 module_hook($module, $hook)
icor7 module_hook($module, $hook)
meedjum_blog7 module_hook($module, $hook)
mooc7 module_hook($module, $hook)

Determines whether a module implements a hook.


$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 calls to module_hook()
defaultconfig_features_export_alter in sites/all/modules/ulmus/defaultconfig/defaultconfig.module
Implements hook_features_export_alter().
defaultconfig_modules_disabled in sites/all/modules/ulmus/defaultconfig/defaultconfig.module
Implements hook_modules_disabled().
defaultconfig_modules_installed in sites/all/modules/ulmus/defaultconfig/defaultconfig.module
Implements hook_modules_installed().
drupal_check_module in includes/
Checks a module's requirements.
entity_entity_property_info in sites/all/modules/ulmus/entity/
Implements hook_entity_property_info().

... See full list


includes/, line 659
API for loading and interacting with Drupal modules.


function module_hook($module, $hook) {
  $function = $module . '_' . $hook;
  if (function_exists($function)) {
    return TRUE;
  // If the hook implementation does not exist, check whether it may live in an
  // optional include file registered via hook_hook_info().
  $hook_info = module_hook_info();
  if (isset($hook_info[$hook]['group'])) {
    module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']);
    if (function_exists($function)) {
      return TRUE;
  return FALSE;