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

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 7 20:59:16 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 westi):

 Reproduced with this:

 {{{
 function query_tests() {
         query_test_one();
         query_test_two();
 }

 function query_test_one() {
         $one = new WP_Query();
         $one->query( array( 'category__in' => array( 1 ) ) );
 }
 function query_test_two() {
         $one = new WP_Query();
         $one->query( array( 'category__in' => 1 ) );
 }

 add_action( 'wp_footer', 'query_tests' , 1);
 }}}

 The first produces a valid query.

 The second produces a notice:

 WARNING: wp-includes/query.php:1695 - array_unique() expects parameter 1
 to be array, integer given

 Seeing as this was added in 3.1 and then removed again I think we can move
 this to 3.2 as an enhancement.

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


More information about the wp-trac mailing list