mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Ensure that terms with a post count of 0
are not returned in wp_count_terms()
when hide_empty => true
. Adds unit test which ensures that wp_count_terms()
returns 0
.
Props markjaquith. Fixes #15919. Built from https://develop.svn.wordpress.org/trunk@25551 git-svn-id: http://core.svn.wordpress.org/trunk@25471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c2312dfe4c
commit
2d323d43e1
@ -1369,6 +1369,9 @@ function get_terms($taxonomies, $args = '') {
|
|||||||
$where .= " AND tt.parent = '$parent'";
|
$where .= " AND tt.parent = '$parent'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( 'count' == $fields )
|
||||||
|
$hierarchical = false;
|
||||||
|
|
||||||
if ( $hide_empty && !$hierarchical )
|
if ( $hide_empty && !$hierarchical )
|
||||||
$where .= ' AND tt.count > 0';
|
$where .= ' AND tt.count > 0';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user