aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/events/advanced.php
blob: 73edea9dae6746a198ec6b3a7d449ea9e17f5ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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, $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();
}