]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/taxonomy.php
Wordpress 3.1.4
[autoinstalls/wordpress.git] / wp-includes / taxonomy.php
index d9ae2d5a8b40603db843ceee24db3c5c64960400..9e9d24aeea6065ef76268702321bc9f8d7caad23 100644 (file)
@@ -1194,6 +1194,8 @@ function &get_terms($taxonomies, $args = '') {
                $orderby = '';
        elseif ( empty($_orderby) || 'id' == $_orderby )
                $orderby = 't.term_id';
+       else
+               $orderby = 't.name';
 
        $orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
 
@@ -1202,6 +1204,10 @@ function &get_terms($taxonomies, $args = '') {
        else
                $order = '';
 
+       $order = strtoupper( $order );
+       if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
+               $order = 'ASC';
+
        $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
        $inclusions = '';
        if ( !empty($include) ) {