[wp-trac] [WordPress Trac] #16320: pre_get_posts and category__in affects category dropdown
WordPress Trac
wp-trac at lists.automattic.com
Thu Jan 20 18:24:50 UTC 2011
#16320: pre_get_posts and category__in affects category dropdown
--------------------------+------------------------------
Reporter: mmuro | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 3.1
Severity: normal | Resolution:
Keywords: close |
--------------------------+------------------------------
Comment (by mmuro):
Replying to [comment:1 scribu]:
> Of course it selects the category, because it's the same as going to
{{{/wp-admin/edit.php?cat=1}}}
>
> What I'm saying is that the correct behaviour is the current one, not
the one in 3.0.4.
>
> If you don't want that code to affect the admin area, just add an
is_admin() check:
>
> {{{
> if ( !is_admin() )
> add_filter( 'pre_get_posts','my_posts_query' );
> }}}
And if you have multiple categories in the array?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16320#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list