module_hook

Definition

module_hook($module, $hook)
includes/module.inc, line 384

Description

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

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

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

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.