Elgg  Version 2.3
Go to the documentation of this file.
1 <?php
7 elgg_register_event_handler('create', 'object', 'example_event_handler');
9 function example_event_handler($event, $type, $object) {
10  // Don't allow any non-admin users to create objects
11  // Returning false from this function will halt the creation of the object.
12  return elgg_is_admin_logged_in();
13 }
These two snippets demonstrates triggering an event and how to register for that event.
Definition: trigger.php:7
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:60
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Definition: elgglib.php:550
example_event_handler($event, $type, $object)
Definition: advanced.php:9
if(!$display_name) $type
Definition: delete.php:27