• Resolved lassrladd

    (@icanhazcookies)


    I’m trying to filter the event listing by using a custom taxonomy as described in a couple of other topics, here’s my code:

    function filter_events_location($events, $args){
        global $current_location;
    	foreach($events as $event_key => $EM_Event){
    		if(!is_object_in_term($EM_Event->post_id, 'site-location', $current_location))
    			unset($events[$event_key]);
    	}
    	return $events;
    }
    add_filter('em_events_get','filter_events_location',1,2);

    However, this causes the pagination to break in event listings: the plugin creates as many pages as there would have been if the filter was not in place, and on top of that, some pages are blank, since the filter seems to be applying too late ( the plugin counted the unfiltered events for those pages and since the events were removed too late, they are not displayed, but they were still included in the loop ).

    I hope what I’ve said is clear enough, if not, I guess I could replicate the problem on a development server in order to show you what I mean.

    http://wordpress.org/extend/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Taxonomy filter breaks pagination’ is closed to new replies.