aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-28 14:14:22 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-28 14:14:22 +0000
commit60d3843934d6b3388d03f2358b23e9cefa97f4a2 (patch)
tree27aa988279000d0c0a99f15ab5ffa6e59bccc017
parenta892d01721e2730badadc885d1adb089fdde4557 (diff)
downloadelgg-60d3843934d6b3388d03f2358b23e9cefa97f4a2.tar.gz
elgg-60d3843934d6b3388d03f2358b23e9cefa97f4a2.tar.bz2
Added custom return values to trigger_plugin_hook
git-svn-id: https://code.elgg.org/elgg/trunk@278 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/elgglib.php5
1 files changed, 2 insertions, 3 deletions
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);