From 60d3843934d6b3388d03f2358b23e9cefa97f4a2 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 28 Mar 2008 14:14:22 +0000 Subject: Added custom return values to trigger_plugin_hook git-svn-id: https://code.elgg.org/elgg/trunk@278 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index c711dd879..f421673e6 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -659,13 +659,12 @@ * @param string $hook The name of the hook to trigger * @param string $entity_type The name of the entity type to trigger it for (or "all", or "none") * @param array $params Any parameters. It's good practice to name the keys, i.e. by using array('name' => 'value', 'name2' => 'value2') + * @param mixed $returnvalue An initial return value * @return mixed|null The cumulative return value for the plugin hook functions */ - function trigger_plugin_hook($hook, $entity_type, $params = null) { + function trigger_plugin_hook($hook, $entity_type, $params = null, $returnvalue = null) { global $CONFIG; - $returnvalue = null; - if (!empty($CONFIG->hooks[$hook][$entity_type]) && is_array($CONFIG->hooks[$hook][$entity_type])) { foreach($CONFIG->hooks[$hook][$entity_type] as $hookfunction) { $temp_return_value = $hookfunction($hook, $entity_type, $returnvalue, $params); -- cgit v1.2.3