[wp-trac] [WordPress Trac] #16814: WP_Query doesn't check orderby for meta_query

WordPress Trac noreply at wordpress.org
Fri Oct 3 13:30:47 UTC 2014


#16814: WP_Query doesn't check orderby for meta_query
--------------------------+------------------------------
 Reporter:  dalesaurus    |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by kovshenin):

 * keywords:   => has-patch
 * status:  closed => reopened
 * resolution:  duplicate =>
 * milestone:   => Awaiting Review


Comment:

 I'd like to reopen this, because r25255 has added even more
 inconsistencies between a meta_query and a combination of meta_key,
 meta_value, etc. When providing a meta_type key, orderby=meta_value will
 cast to that type, but a type key in a meta_query won't.

 In fact, a meta_query won't even add meta strings to $allowed_keys as
 stated by the reporter. This is a bit ironic, because a combination of
 meta_key, meta_value, etc. does resolve into a meta_query.

 [attachment:16814.diff] is a proposed fix + tests.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/16814#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list