function crumbs_CallbackRestoration::restoreCallback in Crumbs, the Breadcrumbs suite 7.2
Parameters
string $module:
string $key:
string $callback_type: E.g. 'routeParent'.
Return value
callback
File
- lib/
CallbackRestoration.php, line 50
Class
- crumbs_CallbackRestoration
- Can recover anonymous functions registered with hook_crumbs_plugins() via e.g. $api->routeParentCallback() or $api->entityParentCallback()
Code
function restoreCallback($module, $key, $callback_type) {
if (!isset($this->modulesRestored[$module])) {
$f = $module . '_crumbs_plugins';
// The module may have been disabled in the meantime,
// or the function may have been removed by a developer.
if (function_exists($f)) {
$this->api
->setModule($module);
$f($this->api);
}
$this->modulesRestored[$module] = TRUE;
}
return $this->callbackCollection
->getCallbackOrFalse($module, $callback_type, $key);
}