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:
parent
6ce726545b
commit
0495192229
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue