Make _get_term_hierarchy() query more efficient.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-01-12 20:12:04 +00:00
parent 6ce726545b
commit 0495192229
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;