Make WordPress Core


Ignore:
Timestamp:
11/06/2014 09:46:18 PM (11 years ago)
Author:
boonebgorges
Message:

Don't force child_of=0 for non-hierarchical taxonomies in get_terms().

This forcing appears to have been introduced to save unnecessary queries, but
(a) in some cases it appeared to be causing *more* queries, and (b) it caused
incorrect results when the 'exclude_tree' param of get_terms() called
get_terms() on each item in the tree using the 'child_of' param.

Fixes #30275.

File:
1 edited

Legend:

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

    r30241 r30265  
    16501650    // Save queries by not crawling the tree in the case of multiple taxes or a flat tax.
    16511651    if ( ! $single_taxonomy || ! is_taxonomy_hierarchical( reset( $taxonomies ) ) ) {
    1652         $args['child_of'] = false;
    16531652        $args['hierarchical'] = false;
    16541653        $args['pad_counts'] = false;
Note: See TracChangeset for help on using the changeset viewer.