From c357de63ef6945c6c8815be1ab770fd5b9aeb2bf Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 6 Nov 2014 21:47:23 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@30265 git-svn-id: http://core.svn.wordpress.org/trunk@30265 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy.php | 1 - wp-includes/version.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 7d341edae4..c898cbf18a 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1649,7 +1649,6 @@ function get_terms( $taxonomies, $args = '' ) { // Save queries by not crawling the tree in the case of multiple taxes or a flat tax. if ( ! $single_taxonomy || ! is_taxonomy_hierarchical( reset( $taxonomies ) ) ) { - $args['child_of'] = false; $args['hierarchical'] = false; $args['pad_counts'] = false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 54efddf690..ea3243b3ae 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30264'; +$wp_version = '4.1-alpha-30265'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.