From 480501c6a8e308047183d65a246a627571a4ffc2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 17 Nov 2016 18:02:30 +0000 Subject: [PATCH] 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 --- wp-includes/category-template.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index fab2640c0b..ac992d6b3c 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -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 .= ''; + } /** * Filters the HTML output of a taxonomy list. diff --git a/wp-includes/version.php b/wp-includes/version.php index b971fddc06..6b3b87cae5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.