WordPress.org

Make WordPress Core

Ticket #19776: 19776.3.patch

File 19776.3.patch, 897 bytes (added by linuxologos, 6 years ago)

Hopefully a better effort...

  • wp-includes/category-template.php

     
    337337        $class = esc_attr( $class );
    338338        $id = $id ? esc_attr( $id ) : $name;
    339339
     340        $output = '';
    340341        if ( ! $r['hide_if_empty'] || ! empty($categories) )
    341342                $output = "<select name='$name' id='$id' class='$class' $tab_index_attribute>\n";
    342         else
    343                 $output = '';
    344343
    345         if ( empty($categories) && ! $r['hide_if_empty'] && !empty($show_option_none) ) {
     344        if ( empty($categories) && ! $r['hide_if_empty'] ) {
     345                $show_option_none = ! empty( $show_option_none ) ? $show_option_none : __( 'No categories' );
    346346                $show_option_none = apply_filters( 'list_cats', $show_option_none );
    347347                $output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n";
    348348        }