• Resolved crispy82

    (@crispy82)


    Hi,

    I would like to know if there is way to add categories and tags on the Bookings Table?

    Thanks a mil,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    Just to confirm, did you mean under wp-admin > events > bookings?

    Thread Starter crispy82

    (@crispy82)

    Hi,

    Exactly!

    Thanks

    Plugin Support angelo_nwl

    (@angelo_nwl)

    You can try this custom snippet:

    **As for where to paste custom snippet: https://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/

    /*
     * This snippet shows Event Tags and Categories under Events > Bookings > Click on the Gear Icon
     */
    function em_bookings_table_cols_template_event_tags($template, $EM_Bookings_Table){
    	$template['event_tags'] = 'Event Tags';
    	return $template;
    }
    function em_bookings_table_rows_col_event_tags($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
    	if( $col == 'event_tags' ){
    		$EM_Event = $EM_Booking->get_event();
    		$EM_Tags = get_the_terms($EM_Event->post_id, EM_TAXONOMY_TAG);
    		foreach($EM_Tags as $EM_Tag):
    			$val .= $EM_Tag->name." | ";
    		endforeach;
    	}
    	return $val;
    }
    
    function em_bookings_table_cols_template_event_categories($template, $EM_Bookings_Table){
    	$template['event_categories'] = 'Event Categories';
    	return $template;
    }
    function em_bookings_table_rows_col_event_categories($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
    	if( $col == 'event_categories' ){
    		$EM_Event = $EM_Booking->get_event();
    		foreach($EM_Event->get_categories() as $EM_Category):
    			$val .= $EM_Category->name." | ";
    		endforeach;
    	}
    	return $val;
    }
    
    add_action('em_bookings_table_cols_template', 'em_bookings_table_cols_template_event_tags',10,2);
    add_filter('em_bookings_table_rows_col','em_bookings_table_rows_col_event_tags', 10, 5);
    
    add_action('em_bookings_table_cols_template', 'em_bookings_table_cols_template_event_categories',10,2);
    add_filter('em_bookings_table_rows_col','em_bookings_table_rows_col_event_categories', 10, 5);
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Manage Attendees – The Bookings Table’ is closed to new replies.