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
- $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){
- $attendees_list = "";
- $attendees = $EM_Booking->booking_meta['attendees'];
- if ( !empty($attendees) ){
- foreach($attendees as $key => $value) {
- $attendees_list = "<ul style='padding-left:20px'>";
- foreach($value as $key_attendee => $value_attendee) {
- $attendees_list .= "<li>".$value_attendee["attendee_name"]."</li>";
- }
- $attendees_list .= "</ul>";
- }
- }
- echo '<li>'. $EM_Booking->get_person()->get_name() .' '. $EM_Booking->output("#_BOOKINGFORMCUSTOM{field_id}").$attendees_list.'</li>';
- }
- }
- ?>
- </ul>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement