advanced.php 406 B

1234567891011121314
  1. <?php
  2. /**
  3. * This snippets demonstrates how returning false changes the normal operation
  4. * of Elgg.
  5. */
  6. elgg_register_event_handler('create', 'object', 'example_event_handler');
  7. function example_event_handler($event, $type, $object) {
  8. // Don't allow any non-admin users to create objects
  9. // Returning false from this function will halt the creation of the object.
  10. return elgg_is_admin_logged_in();
  11. }