[wp-trac] [WordPress Trac] #15161: catagories aren't be excluded by pre_get_posts

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 20 00:01:20 UTC 2010


#15161: catagories aren't be excluded by pre_get_posts
--------------------------+-------------------------------------------------
 Reporter:  jorbin        |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.1
Component:  Query         |     Version:  3.1
 Severity:  normal        |    Keywords:     
--------------------------+-------------------------------------------------
 Using a filter such as:
 {{{
 function jorbin_exclude_category($query) {
         if ( $query->is_feed || $query->is_home ) {
                 $query->set('cat', '-9,-2,-8,-25,-13');
         }
         return $query;
 }

 add_filter('pre_get_posts', 'jorbin_exclude_category');
 }}}

 Fails on trunk, but works on 3.0.1 .  It sets the category properly, but
 the posts aren't filtered out, so I hesitate to blame #14494

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15161>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list