[wp-trac] [WordPress Trac] #33460: wp_list_categories should display title_li only if the $categories is not empty , or have an option to hide it if $categories is empty
WordPress Trac
noreply at wordpress.org
Thu Aug 20 08:02:41 UTC 2015
#33460: wp_list_categories should display title_li only if the $categories is not
empty , or have an option to hide it if $categories is empty
-------------------------+-----------------------------
Reporter: vilkatis | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
This part of wp_list_categories:
{{{
if ( $r['title_li'] && 'list' == $r['style'] ) {
$output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li']
. '<ul>';
}
}}}
Should be
{{{
if ( $r['title_li'] && 'list' == $r['style'] && (!empty($categories))) {
$output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li']
. '<ul>';
}
}}}
or is this intended behavior?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33460>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list