[wp-trac] [WordPress Trac] #18707: Meta Query printing "array" in query whwn compara type is LIKE

WordPress Trac noreply at wordpress.org
Tue Dec 11 23:08:50 UTC 2012


#18707: Meta Query printing "array" in query whwn compara type is LIKE
-----------------------------------+------------------------------
 Reporter:  tplayer                |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Query                  |     Version:  3.2.1
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------------------
Changes (by robmiller):

 * cc: r@… (added)
 * keywords:  needs-patch => has-patch 2nd-opinion


Comment:

 Here's a first, rough crack at extending the meta query logic to allow an
 array of values. If a single value is passed, you get the `LIKE "%foo%"`
 that you'd expect; if you pass an array of values, you get e.g. `LIKE
 "%foo%" OR LIKE "%bar%"`.

 Would appreciate anyone's thoughts; it feels somewhat dirty at the moment
 but that's primarily because I didn't want to redo the current logic too
 much.

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


More information about the wp-trac mailing list