aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/basic.php
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/examples/hooks/basic.php')
-rw-r--r--documentation/examples/hooks/basic.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/documentation/examples/hooks/basic.php b/documentation/examples/hooks/basic.php
new file mode 100644
index 000000000..734d9e884
--- /dev/null
+++ b/documentation/examples/hooks/basic.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * The handler for a plugin hook receives information about the hook (name and
+ * type), the current value for the hook, and parameters related to the hook.
+ */
+
+elgg_register_plugin_hook_handler('forward', '404', 'example_plugin_hook_handler');
+
+function example_plugin_hook_handler($hook, $type, $value, $params) {
+ var_dump($hook);
+ var_dump($type);
+ var_dump($value);
+ var_dump($params);
+
+ // we are not changing $value so return null
+ return null;
+}