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:
parent
0cc431b007
commit
c5c0b4896f
@ -397,12 +397,14 @@ function wp_dropdown_categories( $args = '' ) {
|
|||||||
|
|
||||||
if ( $show_option_all ) {
|
if ( $show_option_all ) {
|
||||||
$show_option_all = apply_filters( 'list_cats', $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 ) {
|
if ( $show_option_none ) {
|
||||||
$show_option_none = apply_filters( 'list_cats', $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 )
|
if ( $hierarchical )
|
||||||
|
Loading…
Reference in New Issue
Block a user