Improve data types returned from empty hierarchical term queries.
When querying for 'count', ensure that 0 is returned. Otherwise, ensure that it's an array. Props xParham, birgire. Fixes #42327. Built from https://develop.svn.wordpress.org/trunk@42209 git-svn-id: http://core.svn.wordpress.org/trunk@42038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aed08a0f25
commit
d86fe35b7f
|
@ -379,7 +379,12 @@ class WP_Term_Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $in_hierarchy ) {
|
if ( ! $in_hierarchy ) {
|
||||||
return array();
|
if ( 'count' == $args['fields'] ) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
$this->terms = array();
|
||||||
|
return $this->terms;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-alpha-42208';
|
$wp_version = '5.0-alpha-42209';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
Loading…
Reference in New Issue