25 $hooks = $this->getOrderedHandlers($hook,
$type);
27 foreach ($hooks as $callback) {
28 if (!is_callable($callback)) {
31 $this->logger->warn(
"handler for plugin hook [$hook, $type] is not callable: "
32 . $inspector->describeCallable($callback));
37 $exit_warning =
function() use ($hook,
$type, $callback) {
40 "'$hook', '$type' plugin hook should not be used to serve a response. Instead return an "
41 .
"appropriate ResponseBuilder instance from an action or page handler. Do not terminate "
42 .
"code execution with exit() or die() in {$inspector->describeCallable($callback)}",
47 if (in_array($hook, [
'forward',
'action',
'route'])) {
48 _elgg_services()->events->registerHandler(
'shutdown',
'system', $exit_warning);
52 $temp_return_value = call_user_func_array($callback,
$args);
53 if (!is_null($temp_return_value)) {
54 $returnvalue = $temp_return_value;
57 if (in_array($hook, [
'forward',
'action',
'route'])) {
58 _elgg_services()->events->unregisterHandler(
'shutdown',
'system', $exit_warning);
if($guid==elgg_get_logged_in_user_guid()) $name
registerHandler($name, $type, $callback, $priority=500)
{Registers a handler.This doesn't check if a callback is valid to be called, only if it is in the cor...
trigger($hook, $type, $params=null, $returnvalue=null)
Triggers a plugin hook.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
if(! $display_name) $type
$args
Some servers don't allow PHP to check the rewrite, so try via AJAX.