Make get_terms() orderby case insensitive, props DD32, fixes #9906

git-svn-id: http://svn.automattic.com/wordpress/trunk@11428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-05-22 12:29:32 +00:00
parent 0632395ad6
commit 284e1c0559
2 changed files with 8 additions and 7 deletions

View File

@ -332,7 +332,7 @@ function category_description( $category = 0 ) {
function wp_dropdown_categories( $args = '' ) {
$defaults = array(
'show_option_all' => '', 'show_option_none' => '',
'orderby' => 'ID', 'order' => 'ASC',
'orderby' => 'id', 'order' => 'ASC',
'show_last_update' => 0, 'show_count' => 0,
'hide_empty' => 1, 'child_of' => 0,
'exclude' => '', 'echo' => 1,

View File

@ -671,15 +671,16 @@ function &get_terms($taxonomies, $args = '') {
return $cache;
}
if ( 'count' == $orderby )
$_orderby = strtolower($orderby);
if ( 'count' == $_orderby )
$orderby = 'tt.count';
else if ( 'name' == $orderby )
else if ( 'name' == $_orderby )
$orderby = 't.name';
else if ( 'slug' == $orderby )
else if ( 'slug' == $_orderby )
$orderby = 't.slug';
else if ( 'term_group' == $orderby )
else if ( 'term_group' == $_orderby )
$orderby = 't.term_group';
elseif ( empty($orderby) || 'id' == $orderby )
elseif ( empty($_orderby) || 'id' == $_orderby )
$orderby = 't.term_id';
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );