Advertisement
eventsmanager

BOOKINGFORMCUSTOM for attendee's

Mar 10th, 2013
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. add_filter('em_booking_output_placeholder','my_em_mod_attendee',1,3);
  2. function my_em_mod_attendee($replace, $EM_Booking, $full_result){
  3. if( empty($replace) || $replace == $full_result ){
  4. $test = $replace;
  5. $replace = "";
  6. $EM_Tickets_Bookings = $EM_Booking->get_tickets_bookings();
  7. $attendee_datas = EM_Attendees_Form::get_booking_attendees($EM_Booking);
  8. foreach( $EM_Tickets_Bookings->tickets_bookings as $EM_Ticket_Booking ){
  9. if( !empty($attendee_datas[$EM_Ticket_Booking->ticket_id]) ){
  10. foreach( $attendee_datas[$EM_Ticket_Booking->ticket_id] as $attendee_title => $attendee_data ){
  11. foreach( $attendee_data as $field_label => $field_value){
  12. $search = str_replace(' ','_',$field_label);
  13. if ( $full_result == '#_BOOKINGFORMCUSTOM{'.strtolower($search).'}' ){
  14. $replace .= $field_value.'</br>';
  15. }
  16. }
  17. }
  18. }
  19. }
  20. }
  21. return $replace;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement