module_implements

Definition

module_implements($hook)
includes/module.inc, line 147

Description

Determine which modules are implementing a hook.

Parameters

$hook The name of the hook (e.g. "help" or "menu").

Return value

An array with the names of the modules which are implementing this hook.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function module_implements($hook) {
  static $implementations;

  if (!isset($implementations[$hook])) {
    $implementations[$hook] = array();
    $list = module_list();
    foreach ($list as $module) {
      if (module_hook($module, $hook)) {
        $implementations[$hook][] = $module;
      }
    }
  }

  return $implementations[$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.