WordPress.org

Make WordPress Core

Opened 9 years ago

Last modified 8 years ago

#16829 closed enhancement

Automatically set 'compare' => 'IN', when meta value is an array — at Version 1

Reported by: scribu Owned by:
Milestone: 3.3 Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch
Focuses: Cc:
PR Number:

Description (last modified by scribu)

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'.

Change History (1)

#1 @scribu
9 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.