Elgg  Version 1.11
PluginHooksService.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg;
4 
17 
24  public function trigger($hook, $type, $params = null, $returnvalue = null) {
25  $hooks = $this->getOrderedHandlers($hook, $type);
26 
27  foreach ($hooks as $callback) {
28  if (!is_callable($callback)) {
29  if ($this->logger) {
30  $inspector = new Inspector();
31  $this->logger->warn("handler for plugin hook [$hook, $type] is not callable: "
32  . $inspector->describeCallable($callback));
33  }
34  continue;
35  }
36 
37  $args = array($hook, $type, $returnvalue, $params);
38  $temp_return_value = call_user_func_array($callback, $args);
39  if (!is_null($temp_return_value)) {
40  $returnvalue = $temp_return_value;
41  }
42  }
43 
44  return $returnvalue;
45  }
46 }
$args
Some servers don&#39;t allow PHP to check the rewrite, so try via AJAX.
$params
Definition: login.php:72
Save menu items.
$type
Definition: add.php:8
trigger($hook, $type, $params=null, $returnvalue=null)
Triggers a plugin hook.