module_implements
- Versions
- 4.6
module_implements($hook)- 4.7
module_implements($hook, $sort = FALSE)- 5 – 6
module_implements($hook, $sort = FALSE,$refresh= FALSE)- 7
module_implements($hook, $sort = FALSE, $reset = FALSE)
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
Code
includes/module.inc, line 147
<?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];
}
?>Login or register to post comments 