Created
August 20, 2012 19:04
-
-
Save vkareh/3406759 to your computer and use it in GitHub Desktop.
module_invoke_last()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function module_invoke_last($hook) { | |
$args = func_get_args(); | |
// Remove $hook from the arguments. | |
unset($args[0]); | |
$result = null; | |
foreach (module_implements($hook) as $module) { | |
$function = $module . '_' . $hook; | |
if (function_exists($function)) { | |
$result = call_user_func_array($function, $args); | |
} | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment