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
This commit is contained in:
parent
1b63ada83d
commit
a0d1faa383
|
@ -996,6 +996,11 @@ class Walker_Category extends Walker {
|
||||||
$category
|
$category
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Don't generate an element if the category name is empty.
|
||||||
|
if ( ! $cat_name ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$link = '<a href="' . esc_url( get_term_link( $category ) ) . '" ';
|
$link = '<a href="' . esc_url( get_term_link( $category ) ) . '" ';
|
||||||
if ( $args['use_desc_for_title'] && ! empty( $category->description ) ) {
|
if ( $args['use_desc_for_title'] && ! empty( $category->description ) ) {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue