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. Built from https://develop.svn.wordpress.org/trunk@32294 git-svn-id: http://core.svn.wordpress.org/trunk@32265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user