From c5c0b4896fce93f627682600b5ba7da775bf2647 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 23 Dec 2008 12:51:12 +0000 Subject: [PATCH] Fix selected for none and all. Props filosofo. fixes #8700 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@10243 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 )