X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/e9d988989fe37ab8c5f903e47fbe36e6e00dc51f..b137f4ce021b4022c56f452c2eafa7abfcef0a7c:/wp-includes/taxonomy.php diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index d9ae2d5a..9e9d24ae 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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) ) {