diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 681ae6fa46..6218896d98 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -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, diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 3120faa866..3c5c1d75c9 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -671,17 +671,18 @@ 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 ); $where = '';