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:
parent
aa053ad0cc
commit
60b50434bd
@ -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
Block a user