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];
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.