Advertisement
eventsmanager

Placeholder to display attendee form

Mar 27th, 2014
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /*
  2. * This custom placeholder will display the attendees using Attendee Form
  3. * where attendee_name is the attendee form field id
  4. */
  5. add_filter('em_event_output_placeholder','em_event_output_placeholder_attendee',1,3);
  6. function em_event_output_placeholder_attendee($replace, $EM_Event, $result){
  7.  
  8. if ( $result == '#_CUSTOMBOOKINGATTENDEES' ) {
  9. $EM_Bookings = $EM_Event->get_bookings();
  10. $replace = "";
  11. foreach( $EM_Bookings as $EM_Booking){
  12.  
  13. $attendees = $EM_Booking->booking_meta['attendees'];
  14. foreach($attendees as $key => $value) {
  15. foreach($value as $key_attendee => $value_attendee) {
  16. $replace .= $value_attendee["attendee_name"].'<br/>';
  17. }
  18. }
  19.  
  20. }
  21. }
  22.  
  23. return $replace;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement