Make WordPress Core


Ignore:
Timestamp:
04/24/2015 06:57:07 PM (11 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/nav-menu.php

    r31748 r32294  
    586586        if ( ! empty( $terms ) ) {
    587587            foreach ( array_keys($terms) as $taxonomy ) {
    588                 get_terms($taxonomy, array('include' => $terms[$taxonomy]) );
     588                get_terms( $taxonomy, array(
     589                    'include' => $terms[ $taxonomy ],
     590                    'hierarchical' => false,
     591                ) );
    589592            }
    590593        }
Note: See TracChangeset for help on using the changeset viewer.