Taxonomy: Don't pass results of 'count' query through 'get_terms' filter.
Use of the 'get_terms' filter was consolidated in [37572], with the introduction of `WP_Term_Query`. At that time, the result of 'count=true' queries began being filtered by 'get_terms'. This breaks existing 'get_terms' callbacks, which often assume that the returned value will be an array or a `WP_Error` object. Props JustinSainton. Fixes #36992. Built from https://develop.svn.wordpress.org/trunk@37623 git-svn-id: http://core.svn.wordpress.org/trunk@37591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0d4aa4df6c
commit
f6980a5fd7
|
@ -1208,6 +1208,11 @@ function get_terms( $args = array(), $deprecated = '' ) {
|
|||
|
||||
$terms = $term_query->query( $args );
|
||||
|
||||
// Count queries are not filtered, for legacy reasons.
|
||||
if ( $term_query->query_vars['count'] ) {
|
||||
return $terms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the found terms.
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.6-alpha-37622';
|
||||
$wp_version = '4.6-alpha-37623';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue