From a0d1faa383de378795d2aacd0a2494b8610b891e Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sat, 3 Jan 2015 02:05:22 +0000 Subject: [PATCH] In `Walker_Category`, don't generate list elements for empty cat names. This change allows the 'list_cats' filter to be used to suppress certain items in category lists, without creating invalid or superfluous markup. Props samo9789. Fixes #16792. Built from https://develop.svn.wordpress.org/trunk@31025 git-svn-id: http://core.svn.wordpress.org/trunk@31006 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 7f2c539676..ad66987f7b 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -996,6 +996,11 @@ class Walker_Category extends Walker { $category ); + // Don't generate an element if the category name is empty. + if ( ! $cat_name ) { + return; + } + $link = 'description ) ) { /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 937b4b977e..4de1766b33 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31024'; +$wp_version = '4.2-alpha-31025'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.