Skip to content

Instantly share code, notes, and snippets.

@vkareh
Created August 20, 2012 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vkareh/3406759 to your computer and use it in GitHub Desktop.
Save vkareh/3406759 to your computer and use it in GitHub Desktop.
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