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

WordPress Trac noreply at wordpress.org
Mon Aug 12 04:17:49 UTC 2013


#17065: Independent ASC/DESC in multiple ORDER BY statement.
-------------------------------------------------+-------------------------
 Reporter:  ericmann                             |       Owner:  ericmann
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  3.7
Component:  Query                                |     Version:  3.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by dd32):

 I like the patch.

 I do have one question though:
 {{{
 // If the next word is ASC or DESC, use it
 // for this sort key and cancel $q['order']
 }}}

 Killing `$q['order']` might not be the best thing here, for example, take:
 {{{
 array(
    'order' => 'ASC',
    'order_by' => 'ID DESC, name'
 }}}
 To me that means order by ID desc, then name ASC, but that's no longer
 explicit.

 Perhaps we'd be best to simply handle `$q['order']` as a default ordering,
 and append a order to every matched item?

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


More information about the wp-trac mailing list