[wp-trac] [WordPress Trac] #16622: [17246] Breaks category exclusion

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 23 20:30:01 UTC 2011


#16622: [17246] Breaks category exclusion
--------------------------+--------------------
 Reporter:  markjaquith   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  3.1.1
Component:  Query         |     Version:  3.1
 Severity:  critical      |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by msafi):

 I use `pre_get_posts` to only include certain categories in the feed and
 homepage, like:

 {{{
 add_filter('pre_get_posts', 'featured_posts');
 function featured_posts($query)
 {
         if (is_single()) return;

         if ($query->is_home)
         {
                 $query->set('cat', '50');
                 return $query;
         }

         if ($query->is_feed)
         {
                 $query->set('cat', '50,172');
                 return $query;
         }

         return $query;
 }
 }}}

 But none of this code actually works after 3.1.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16622#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list