aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/trigger.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-12 14:49:36 -0500
committercash <cash.costello@gmail.com>2011-11-12 14:49:36 -0500
commit08c5b507bbaf4937ff637bd138f64119873e2922 (patch)
tree756d1fc1d85bac9e5bd71d5a6bb15b7e29ce6cef /documentation/examples/hooks/trigger.php
parent76bea966f7f93e719ccbf6e2350f647636d4da2a (diff)
downloadelgg-08c5b507bbaf4937ff637bd138f64119873e2922.tar.gz
elgg-08c5b507bbaf4937ff637bd138f64119873e2922.tar.bz2
cleaned up the plugin hooks documentation
Diffstat (limited to 'documentation/examples/hooks/trigger.php')
-rw-r--r--documentation/examples/hooks/trigger.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/documentation/examples/hooks/trigger.php b/documentation/examples/hooks/trigger.php
new file mode 100644
index 000000000..4216fd6c0
--- /dev/null
+++ b/documentation/examples/hooks/trigger.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * The current value for the hook is passed into the trigger function. Handlers
+ * can change this value. In this snippet, we check if the value of true was
+ * changed by the handler functions.
+ */
+
+$result = elgg_trigger_plugin_hook('get_status', 'example', null, true);
+
+if ($result) {
+ var_dump('Plugin hook says ok!');
+} else {
+ var_dump('Plugin hook says no.');
+}