Make _get_term_hierarchy() query more efficient.

git-svn-id: https://develop.svn.wordpress.org/trunk@12711 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-01-12 20:12:04 +00:00
parent aa053ad0cc
commit 60b50434bd
1 changed files with 1 additions and 1 deletions

View File

@ -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;