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
This commit is contained in:
Ryan Boren 2008-12-23 12:51:12 +00:00
parent 0cc431b007
commit c5c0b4896f
1 changed files with 4 additions and 2 deletions

View File

@ -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<option value='0'>$show_option_all</option>\n";
$selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
$output .= "\t<option value='0'$selected>$show_option_all</option>\n";
}
if ( $show_option_none ) {
$show_option_none = apply_filters( 'list_cats', $show_option_none );
$output .= "\t<option value='-1'>$show_option_none</option>\n";
$selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : '';
$output .= "\t<option value='-1'$selected>$show_option_none</option>\n";
}
if ( $hierarchical )