diff options
Diffstat (limited to 'documentation/examples/events/advanced.php')
| -rw-r--r-- | documentation/examples/events/advanced.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/documentation/examples/events/advanced.php b/documentation/examples/events/advanced.php index f566e0006..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 isadminloggedin(); + return elgg_is_admin_logged_in(); } - |
