Elgg
Version 1.11
|
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type.This function runs all handlers registered to $hook, $type or the special keyword 'all' for either or both.
Use $params to send additional information to the handler callbacks.
$returnvalue is the initial value to pass to the handlers, which can change it by returning non-null values. It is useful to use $returnvalue to set defaults. If no handlers are registered, $returnvalue is immediately returned.
Handlers that return null (or with no explicit return or return value) will not change the value of $returnvalue.
$hook is usually a verb: import, get_views, output.
$type is usually a noun: user, ecml, page.
Like Elgg Events, $hook and $type can use the special keyword 'all'. Handler callbacks registered with $hook = all will be called for all hooks of type $type. Similarly, handlers registered with $type = all will be called for all hooks of type $event, regardless of $object_type. If $hook and $type both are 'all', the handler will be called for all hooks.
It's not possible for a plugin hook to change a non-null $returnvalue to null.
string | $hook | The name of the hook to trigger ("all" will trigger for all $types regardless of $hook value) |
string | $type | The type of the hook to trigger ("all" will trigger for all $hooks regardless of $type value) |
mixed | $params | Additional parameters to pass to the handlers |
mixed | $returnvalue | An initial return value |
Trigger a hook that determines if execution should continue.