mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@31025 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 = '<a href="' . esc_url( get_term_link( $category ) ) . '" ';
|
||||
if ( $args['use_desc_for_title'] && ! empty( $category->description ) ) {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user