Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * paste in your theme functions.php or wp-content/mu-plugins/function.php
- * After adding in your functions.php, go to Events > Bookings > Recent Bookings or by clicking on the Event
- * click on the Gear icon and drag&drop field "Event Categories"
- */
- function my_em_bookings_table_cols_template_event_categories($template, $EM_Bookings_Table){
- $template['event_categories'] = 'Event Categories';
- return $template;
- }
- add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_event_categories',10,2);
- function my_em_custom_booking_form_cols_event_categories($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
- if( $col == 'event_categories' ){
- echo '<ul class="event-categories">';
- foreach($EM_Booking->get_event()->get_categories() as $EM_Category){
- echo '<li>'.$EM_Category->output("#_CATEGORYNAME").'</li>';
- }
- echo '</ul>';
- }
- return $val;
- }
- add_filter('em_bookings_table_rows_col','my_em_custom_booking_form_cols_event_categories', 10, 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement