I’m using the #_ATTENDEES placeholder, but I would like to link attendees’ user avatar to their buddypress profile.
I found this post but I can’t get it to work.
I have tried with this code:
<?php
/* @var $EM_Event EM_Event */
$people = array();
$EM_Bookings = $EM_Event->get_bookings();
if( count($EM_Bookings->bookings) > 0 ){
?>
<ul class="event-attendees">
<?php
$guest_bookings = get_option('dbem_bookings_registration_disable');
$guest_booking_user = get_option('dbem_bookings_registration_user');
foreach( $EM_Bookings as $EM_Booking){
if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
$people[] = $EM_Booking->get_person()->ID;
echo '<li>'<a href="'. bp_core_get_user_domain($EM_Booking->get_person()->ID) . '">'. get_avatar($EM_Booking->get_person()->ID, 50) .'</a>'</li>';
}elseif($EM_Booking->booking_status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){
echo '<li>'. get_avatar($EM_Booking->get_person()->ID, 50) .'</li>';
}
}
?>
placed in /wp-content/themes/twentyfourteen-child/plugins/events-manager/templates/placeholders/
This is an event on my page.
Can anyone help?
Thanks