Trying to add some functionality to my Elgg site when a user adds a friend. As I understand it, an event handler would be the way to do this.
function my_function( $event, $object_type, $object ){
//do something
}
register_elgg_event_handler('friend', 'user', 'my_function');
Is that the correct code? Any help is much appreciated!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Team Webgalli@webgalli
Team Webgalli - 0 likes
- ElggHeader@jpound
ElggHeader - 0 likes
You must log in to post replies.Event hanlder is the way of doing it. You should use the relationship events for that. You can use
elgg_register_event_handler('create', 'friend', 'my_function');
Thank you for the help! I will try using that.