• Resolved jpegtobbe

    (@jpegtobbe)


    I have a problem by a filter remove a category from the calendar. If i load the current month i can see entries that have my category tagged that i do not want to be visible. But if i click next month i still can see entries that should be hidden.. if i click next month and then back one month, then the entries are hidden. Whats happening?

    add_filter( 'tribe_events_views_v2_view_month_repository_args', 'tec_exclude_events_category', 1000, 3 );
    add_filter( 'tribe_events_views_v2_view_list_repository_args', 'tec_exclude_events_category', 1000, 3 );
    add_filter( 'tribe_events_views_v2_view_day_repository_args', 'tec_exclude_events_category', 1000, 3 );
    add_filter( 'tribe_events_views_v2_view_photo_repository_args', 'tec_exclude_events_category', 1000, 3 );
    add_filter( 'tribe_events_views_v2_view_week_repository_args', 'tec_exclude_events_category', 1000, 3 );
    add_filter( 'tribe_events_views_v2_view_map_repository_args', 'tec_exclude_events_category', 1000, 3 );
    function tec_exclude_events_category( $repository_args, $context, $view ) {
    	// List of category slugs to be excluded
    	$excluded_categories = [
    		'category-to-remove'
    	];
    	$repository_args['category_not_in'] = $excluded_categories;
    
      	return $repository_args;
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Erica

    (@eeide)

    Hi @jpegtobbe,

    It sounds like there might be some caching on your site or at the server level, causing these events to be shown initially. Can you please provide the URL to your calendar, so we can take a look?

    Thank you,
    Erica

    Thread Starter jpegtobbe

    (@jpegtobbe)

    I figured it out. It seams that the Events calendar have some sort of cache for the calender posts (?). So after i added my filter code, i needed just to hit update on a calendar post so the events cache was cleard then it worked as intended.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove category from calendar view’ is closed to new replies.