Taxonomy: No, really, don't pass results of 'count' query through 'get_terms' filter.

[37623] used the wrong parameter name (count=true instead of fields=count).

For greater flexibility and forward compatibility with other potential changes
to the return value of `get_terms()`, we now do a looser check: any non-array
value is excluded from the filter.

Fixes #36992.
Built from https://develop.svn.wordpress.org/trunk@37634


git-svn-id: http://core.svn.wordpress.org/trunk@37602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2016-06-04 12:20:28 +00:00
parent 52c0a8fdd8
commit 57e5e7fd79
2 changed files with 2 additions and 2 deletions

View File

@ -1209,7 +1209,7 @@ function get_terms( $args = array(), $deprecated = '' ) {
$terms = $term_query->query( $args ); $terms = $term_query->query( $args );
// Count queries are not filtered, for legacy reasons. // Count queries are not filtered, for legacy reasons.
if ( $term_query->query_vars['count'] ) { if ( ! is_array( $terms ) ) {
return $terms; return $terms;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37633'; $wp_version = '4.6-alpha-37634';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.