[wp-trac] [WordPress Trac] #18832: wp_get_archives should allow for Ascending and Descending ordering

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 1 23:19:58 UTC 2011


#18832: wp_get_archives should allow for Ascending and Descending ordering
-------------------------+------------------------------
 Reporter:  tar.gz       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.3
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------
Changes (by scribu):

 * keywords:   => has-patch


Comment:

 Ok, one important change you need to make:

 Currently, a user could pass {{{'order' => 'DESC, ID ASC'}}}. While it
 might be useful, it's not a good idea to allow such input.

 You should make sure that 'order' can only be 'asc' or 'desc' (case
 insensitive):

 {{{
 $order = ( 'DESC' == strtoupper( $order ) ) ? 'DESC' : 'ASC';
 }}}

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


More information about the wp-trac mailing list