<?php
/*
* paste in your theme functions.php
* after adding in your functions.php, go to Events > Bookings > Recent Bookings or by clicking an specific
* click on the Gear icon and drag&drop field "Booked Tickets"
*/
function my_em_bookings_table_cols_template_tickets($template, $EM_Bookings_Table){
$template['booked_tickets'] = 'Booked Tickets';
return $template;
}
add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_tickets',10,2);
function my_em_custom_booking_form_cols_tickets($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
if( $col == 'booked_tickets' ){
$EM_Tickets_Bookings = $EM_Booking->get_tickets_bookings();
foreach( $EM_Tickets_Bookings->tickets_bookings as $EM_Ticket_Booking ){
$val .= $EM_Ticket_Booking->get_ticket()->ticket_name." <br> ";
}
}
return $val;
}
add_filter('em_bookings_table_rows_col','my_em_custom_booking_form_cols_tickets', 10, 5);
Comments