[wp-trac] [WordPress Trac] #42907: Meta Queries: support ordering by meta_value but still including items without that key

WordPress Trac noreply at wordpress.org
Fri Dec 15 11:30:38 UTC 2017


#42907: Meta Queries: support ordering by meta_value but still including items
without that key
-------------------------+------------------------------
 Reporter:  jdgrimes     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by boonebgorges):

 Hi @jdgrimes - Thanks for the thorough ticket and for the initial proof-
 of-concept.

 Personally, I see a use for this. There have been multiple occasions when
 I've written `EXISTS OR NOT EXISTS` meta queries like the one you've
 described above, and I've run into the same limitation on result ordering.
 More generally, it seems like a gap in the API that ordering by a
 meta_value makes it impossible to include items without that meta_key
 (especially since we support multiple `orderby` clauses). So, I'd say it'd
 definitely be considered.

 I think the following ticket is related. See my comment:
 https://core.trac.wordpress.org/ticket/29447#comment:1

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


More information about the wp-trac mailing list