WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 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:

Description

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)

comment:1 johnbillion5 years ago

NOT LIKE and IN would be handy too

comment:2 dd325 years ago

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

comment:3 westi4 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.