Make WordPress Core


Ignore:
Timestamp:
01/03/2015 02:04:17 AM (10 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category-template.php

    r31024 r31025  
    997997        );
    998998
     999        // Don't generate an element if the category name is empty.
     1000        if ( ! $cat_name ) {
     1001            return;
     1002        }
     1003
    9991004        $link = '<a href="' . esc_url( get_term_link( $category ) ) . '" ';
    10001005        if ( $args['use_desc_for_title'] && ! empty( $category->description ) ) {
Note: See TracChangeset for help on using the changeset viewer.