aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/trigger
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/examples/hooks/trigger')
-rw-r--r--documentation/examples/hooks/trigger/advanced.php9
-rw-r--r--documentation/examples/hooks/trigger/basic.php9
2 files changed, 18 insertions, 0 deletions
diff --git a/documentation/examples/hooks/trigger/advanced.php b/documentation/examples/hooks/trigger/advanced.php
new file mode 100644
index 000000000..de33e7a10
--- /dev/null
+++ b/documentation/examples/hooks/trigger/advanced.php
@@ -0,0 +1,9 @@
+<?php
+
+$default = array('Entry 1', 'Entry 2', 'Entry 3');
+
+$menu = trigger_plugin_hook('get_menu_items', 'menu', null, $default);
+
+foreach ($menu as $item) {
+ var_dump($item);
+}
diff --git a/documentation/examples/hooks/trigger/basic.php b/documentation/examples/hooks/trigger/basic.php
new file mode 100644
index 000000000..a32bf9296
--- /dev/null
+++ b/documentation/examples/hooks/trigger/basic.php
@@ -0,0 +1,9 @@
+<?php
+
+$result = trigger_plugin_hook('get_status', 'example', null, true);
+
+if ($result) {
+ var_dump('Plugin hook says ok!');
+} else {
+ var_dump('Plugin hook says no.');
+}