Skip to content

Instantly share code, notes, and snippets.

@vkareh
Created Aug 20, 2012
Embed
What would you like to do?
module_invoke_last()
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