eventsmanager

Custom buddypress profile link for #_ATTENDEESLIST

Aug 5th, 2015
720
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. This custom template will make the username link to buddypress profile page using placeholder #_ATTENDEELIST
  3. Instructions:
  4. 1. Create these folders inside your current theme directory plugins/events-manager/placeholders
  5. eg. wp-content/themes/Your Theme/plugins/events-manager/placeholders
  6. 2. Inside the above custom directory, create new php file attendeeslist.php
  7. eg. wp-content/themes/Your Theme/plugins/events-manager/placeholders/attendeeslist.php
  8. 3. edit attendeeslist.php and paste the below snippet
  9. 4. use placeholder #_ATTENDEESLIST in your formatting options at Events > Settings > Formatting > Events
  10. */
  11. <?php
  12. /* @var $EM_Event EM_Event */
  13. $people = array();
  14. $EM_Bookings = $EM_Event->get_bookings();
  15. if( count($EM_Bookings->bookings) > 0 ){
  16. ?>
  17. <ul class="event-attendees">
  18. <?php
  19. $guest_bookings = get_option('dbem_bookings_registration_disable');
  20. $guest_booking_user = get_option('dbem_bookings_registration_user');
  21. foreach( $EM_Bookings as $EM_Booking){
  22. if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
  23. $people[] = $EM_Booking->get_person()->ID;
  24. echo '<li>'.bp_core_get_userlink($EM_Booking->get_person()->ID).'</li>';
  25. }elseif($EM_Booking->booking_status == 1 && $guest_bookings && $EM_Booking->get_person()->ID == $guest_booking_user ){
  26. echo '<li>'.bp_core_get_userlink($EM_Booking->get_person()->ID).'</li>';
  27. }
  28. }
  29. ?>
  30. </ul>
  31. <?php
  32. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×