diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index ff24e36125..e3c1b466b3 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -397,12 +397,14 @@ function wp_dropdown_categories( $args = '' ) { if ( $show_option_all ) { $show_option_all = apply_filters( 'list_cats', $show_option_all ); - $output .= "\t\n"; + $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : ''; + $output .= "\t\n"; } if ( $show_option_none ) { $show_option_none = apply_filters( 'list_cats', $show_option_none ); - $output .= "\t\n"; + $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : ''; + $output .= "\t\n"; } if ( $hierarchical )