From 50de2303b0e29b19270ed7e2f4e53f8fac5474ad Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 23 Jun 2017 02:05:19 +0000 Subject: [PATCH] When querying for terms, do not assume that `$taxonomies` is a 0-indexed array. In [25108], the logic of term queries was modified to avoid assuming that the `taxonomies` array was numerically indexed. See #23506. This fix was inadvertantly reverted during the refactor in [25162]. Props david.binda. Fixes #41113. git-svn-id: https://develop.svn.wordpress.org/trunk@40924 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-term-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-term-query.php b/src/wp-includes/class-wp-term-query.php index 2f3da47301..376f1b94fd 100644 --- a/src/wp-includes/class-wp-term-query.php +++ b/src/wp-includes/class-wp-term-query.php @@ -429,7 +429,7 @@ class WP_Term_Query { foreach ( $exclude_tree as $extrunk ) { $excluded_children = array_merge( $excluded_children, - (array) get_terms( $taxonomies[0], array( + (array) get_terms( reset( $taxonomies ), array( 'child_of' => intval( $extrunk ), 'fields' => 'ids', 'hide_empty' => 0