Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * This snippet will override template when using placeholder #_ATTENDEESLIST and will add attendee names captured by attendee form
- * This assumes that you are using a field with ID attendee_name in your attendee form.
- *
- * How to install:
- * 1. create these folders within your theme directory
- * wp-contents > themes > Your Theme > (create these folders) plugins > events-manager > placeholders
- * 2. create attendeeslist.php inside placeholder folder at step#1 then edit
- * 3. paste this whole snippet
- */
- /* @var $EM_Event EM_Event */
- $people = array();
- $EM_Bookings = $EM_Event->get_bookings();
- if( count($EM_Bookings->bookings) > 0 ){
- ?>
- <ul class="event-attendees">
- <?php
- foreach( $EM_Bookings as $EM_Booking){ /* @var $EM_Booking EM_Booking */
- if($EM_Booking->booking_status == 1 && !in_array($EM_Booking->get_person()->ID, $people) ){
- $people[] = $EM_Booking->get_person()->ID;
- echo '<li>'. $EM_Booking->get_person()->get_name() . ' - ' . $EM_Booking->get_spaces() . ' space(s)' .'</li>';
- }elseif($EM_Booking->booking_status == 1 && $EM_Booking->is_no_user() ){
- echo '<li>'. $EM_Booking->get_person()->get_name() . ' - ' . $EM_Booking->get_spaces() . ' space(s)' .'</li>';
- }
- }
- ?>
- </ul>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement