[wp-trac] [WordPress Trac] #14892: minor improvement on category__in

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 7 21:07:45 UTC 2011


#14892: minor improvement on category__in
--------------------------------------+-----------------------
 Reporter:  sboisvert                 |       Owner:  scribu
     Type:  enhancement               |      Status:  reopened
 Priority:  normal                    |   Milestone:  3.1
Component:  Query                     |     Version:  3.1
 Severity:  minor                     |  Resolution:
 Keywords:  query, reporter-feedback  |
--------------------------------------+-----------------------

Comment (by linuxologos):

 And even simplier:

 The code below should be working according to [15626]:

 {{{
 query_posts( array( 'category__in' => 353 ) )
 }}}
 but it does not, returning unexpected posts and the already mentioned
 warning:

 {{{
 array_unique() expects parameter 1 to be array, integer given in ...\wp-
 includes\query.php on line 1695
 }}}
 The code works as expected only if category_in is provided an array (just
 like in the past), for example:

 {{{
 query_posts( array( 'category__in' => (array)353 ) ) or
 query_posts( array( 'category__in' => array(353) ) )
 }}}

 Tag_in/tag_not_in (and possibly other parameters too) are working fine
 with integers, as they should according to [15626].

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


More information about the wp-trac mailing list