Skip to content

Commit

Permalink
When priming the cache for taxonomy term nav items, don't fetch term …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
boonebgorges committed Apr 24, 2015
1 parent 317150c commit fbf1657
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion wp-includes/nav-menu.php
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -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.
Expand Down

0 comments on commit fbf1657

Please sign in to comment.