WordPress.org

Make WordPress Core

Changeset 10243


Ignore:
Timestamp:
12/23/08 12:51:12 (5 years ago)
Author:
ryan
Message:

Fix selected for none and all. Props filosofo. fixes #8700 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r10192 r10243  
    398398        if ( $show_option_all ) { 
    399399            $show_option_all = apply_filters( 'list_cats', $show_option_all ); 
    400             $output .= "\t<option value='0'>$show_option_all</option>\n"; 
     400            $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : ''; 
     401            $output .= "\t<option value='0'$selected>$show_option_all</option>\n"; 
    401402        } 
    402403 
    403404        if ( $show_option_none ) { 
    404405            $show_option_none = apply_filters( 'list_cats', $show_option_none ); 
    405             $output .= "\t<option value='-1'>$show_option_none</option>\n"; 
     406            $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : ''; 
     407            $output .= "\t<option value='-1'$selected>$show_option_none</option>\n"; 
    406408        } 
    407409 
Note: See TracChangeset for help on using the changeset viewer.