When priming the cache for taxonomy term nav items, don't fetch term descendants.

Descending the term tree causes unnecessary database queries when priming the
cache for a term with many descendants.

Fixes #31724.

git-svn-id: https://develop.svn.wordpress.org/trunk@32294 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-04-24 18:57:07 +00:00
parent 7add279793
commit c3ea088948
2 changed files with 23 additions and 1 deletions

View File

@@ -585,7 +585,10 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
if ( ! empty( $terms ) ) {
foreach ( array_keys($terms) as $taxonomy ) {
get_terms($taxonomy, array('include' => $terms[$taxonomy]) );
get_terms( $taxonomy, array(
'include' => $terms[ $taxonomy ],
'hierarchical' => false,
) );
}
}
unset($terms);