[wp-trac] [WordPress Trac] #17065: Independent ASC/DESC in multiple ORDER BY statement.

WordPress Trac noreply at wordpress.org
Wed Jul 9 18:47:10 UTC 2014


#17065: Independent ASC/DESC in multiple ORDER BY statement.
----------------------------+-----------------------
 Reporter:  ericmann        |       Owner:  ericmann
     Type:  task (blessed)  |      Status:  closed
 Priority:  normal          |   Milestone:  4.0
Component:  Query           |     Version:  3.1
 Severity:  normal          |  Resolution:  fixed
 Keywords:  has-patch       |     Focuses:
----------------------------+-----------------------

Comment (by stephenharris):

 In this latest patch, would it be an idea to add a filter to
 `parse_orderby()`? My reasoning is that a plug-in may add their own sort
 key, and this would be lost.

 As it stands you would have to use the `posts_orderby` filter - but when
 there are multiple sort keys you have to then rebuild the SQL segment.
 That in itself is OK, but if there are multiple 'unknown' keys from
 different plug-ins, it becomes impossible to produce the desired SQL.

 It's an edge case, for sure, but I thought I'd put it out there.

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


More information about the wp-trac mailing list