aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/events/advanced.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-12 14:28:52 -0500
committercash <cash.costello@gmail.com>2011-11-12 14:28:52 -0500
commit76bea966f7f93e719ccbf6e2350f647636d4da2a (patch)
tree87b7b8851b4161be827af5ee9a194fc3553ff29a /documentation/examples/events/advanced.php
parent88d597c63a9691c9714e9db4dbe676028e548be8 (diff)
downloadelgg-76bea966f7f93e719ccbf6e2350f647636d4da2a.tar.gz
elgg-76bea966f7f93e719ccbf6e2350f647636d4da2a.tar.bz2
added better plugin skeleton and added documentation to some of the examples
Diffstat (limited to 'documentation/examples/events/advanced.php')
-rw-r--r--documentation/examples/events/advanced.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/documentation/examples/events/advanced.php b/documentation/examples/events/advanced.php
index 22a407579..73edea9da 100644
--- a/documentation/examples/events/advanced.php
+++ b/documentation/examples/events/advanced.php
@@ -1,10 +1,13 @@
<?php
+/**
+ * This snippets demonstrates how returning false changes the normal operation
+ * of Elgg.
+ */
elgg_register_event_handler('create', 'object', 'example_event_handler');
-function example_event_handler($event, $type, $params) {
+function example_event_handler($event, $type, $object) {
// Don't allow any non-admin users to create objects
// Returning false from this function will halt the creation of the object.
return elgg_is_admin_logged_in();
}
-