From 60b50434bd78c45b986fdbd1625e031e3796ebbe Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 12 Jan 2010 20:12:04 +0000 Subject: [PATCH] Make _get_term_hierarchy() query more efficient. git-svn-id: https://develop.svn.wordpress.org/trunk@12711 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 bd9cd6853f..0d5bce4804 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;