[wp-trac] [WordPress Trac] #16829: Automatically set 'compare' => 'IN', when meta value is an array

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 10 22:35:05 UTC 2011


#16829: Automatically set 'compare' => 'IN', when meta value is an array
-------------------------+-----------------------------
 Reporter:  scribu       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Query        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+-----------------------------
Description changed by scribu:

Old description:

> {{{
> get_posts( array(
>   'meta_key' => 'foo',
>   'meta_value' => array( 'bar', baz' )
> ) );
> }}}
>
> should just work.
>
> Currently, you have to remember to set meta compare:
>
> {{{
> get_posts( array(
>   'meta_key' => 'foo',
>   'meta_value' => array( 'bar', baz' ),
>   'meta_compare' => 'IN'
> ) );
> }}}

New description:

 {{{
 get_posts( array(
   'meta_key' => 'foo',
   'meta_value' => array( 'bar', baz' )
 ) );
 }}}

 should just work.

 Currently, you have to remember to set meta compare:

 {{{
 get_posts( array(
   'meta_key' => 'foo',
   'meta_value' => array( 'bar', baz' ),
   'meta_compare' => 'IN'
 ) );
 }}}

 Obviously, it should be the same when using 'meta_query'.

--

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


More information about the wp-trac mailing list