From 04951922299f0990949661512a0e8992c07956b0 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 12 Jan 2010 20:12:04 +0000 Subject: [PATCH] Make _get_term_hierarchy() query more efficient. git-svn-id: http://svn.automattic.com/wordpress/trunk@12711 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index bd9cd6853..0d5bce480 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2066,7 +2066,7 @@ function _get_term_hierarchy($taxonomy) { return $children; $children = array(); - $terms = get_terms($taxonomy, array('get' => 'all')); + $terms = get_terms($taxonomy, array('get' => 'all', 'orderby' => 'id', 'fields' => 'ids')); foreach ( $terms as $term ) { if ( $term->parent > 0 ) $children[$term->parent][] = $term->term_id;