From e3996719d3b6dcf066aa5b31948484a98d21e5a1 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 3 Mar 2017 03:01:39 +0000 Subject: [PATCH] Taxonomy: When querying terms, ensure `$taxonomies` is an array. This avoids PHP notices that otherwise arise when no `taxonomy` parameter is passed to `get_terms()` or `WP_Term_Query`. Props dlh. Fixes #39932. git-svn-id: https://develop.svn.wordpress.org/trunk@40147 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 961bd0e101..79ec315c4f 100644 --- a/src/wp-includes/class-wp-term-query.php +++ b/src/wp-includes/class-wp-term-query.php @@ -323,7 +323,7 @@ class WP_Term_Query { */ do_action( 'pre_get_terms', $this ); - $taxonomies = $args['taxonomy']; + $taxonomies = (array) $args['taxonomy']; // Save queries by not crawling the tree in the case of multiple taxes or a flat tax. $has_hierarchical_tax = false;