diff options
Diffstat (limited to 'documentation/examples/events/advanced.php')
-rw-r--r-- | documentation/examples/events/advanced.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/documentation/examples/events/advanced.php b/documentation/examples/events/advanced.php new file mode 100644 index 000000000..c6fc2d0fb --- /dev/null +++ b/documentation/examples/events/advanced.php @@ -0,0 +1,10 @@ +<?php + +register_elgg_event_handler('create', 'object', 'example_event_handler'); + +function example_event_handler($event, $type, $params) { + // Don't allow any non-admin users to create objects + // Returning false from this function will halt the creation of the object. + return isadminloggedin(); +} + |