From fbf16573ee130da664b6ca7e3633e71484eb402a Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 24 Apr 2015 18:58:27 +0000 Subject: [PATCH] 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 --- wp-includes/nav-menu.php | 5 ++++- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index 48549b1aaa..2c610e80da 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -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); diff --git a/wp-includes/version.php b/wp-includes/version.php index 146e21fffb..0f9f24d325 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32293'; +$wp_version = '4.3-alpha-32294'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.