Taxonomy: Prevent wp_list_categories() from producing not well-nested output if hide_title_if_empty is true.

Props chesio.
Fixes #38839. See #33460.
Built from https://develop.svn.wordpress.org/trunk@39280


git-svn-id: http://core.svn.wordpress.org/trunk@39220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-11-17 18:02:30 +00:00
parent 5e88248a44
commit 480501c6a8
2 changed files with 3 additions and 2 deletions

View File

@ -624,8 +624,9 @@ function wp_list_categories( $args = '' ) {
$output .= walk_category_tree( $categories, $depth, $r );
}
if ( $r['title_li'] && 'list' == $r['style'] )
if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
$output .= '</ul></li>';
}
/**
* Filters the HTML output of a taxonomy list.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta4-39279';
$wp_version = '4.7-beta4-39280';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.