Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#10800 closed enhancement (duplicate)

Allow LIKE comparison for $q['meta_compare']

Reported by: johncoswell Owned by: ryan
Milestone: Priority: lowest
Severity: trivial Version: 2.8.4
Component: Query Keywords:
Focuses: Cc:


I am working on a plugin that will be doing plaintext searches of a metadata property. It would be helpful to have the LIKE operator available to 'meta_compare' within WP_Query::get_posts so that I don't have to create a new filter to accomplish the same result:

in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=', 'LIKE'))

Change History (3)

#1 @johnbillion
9 years ago

NOT LIKE and IN would be handy too

#2 @dd32
9 years ago

See Also: #9124 - meta_compare needs to allow "in" as well

#3 @westi
9 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing as a dupe of #11482 as that is for the same enhancement and has a patch.

Note: See TracTickets for help on using tickets.