Make WordPress Core


Ignore:
Timestamp:
05/21/2010 02:35:39 PM (15 years ago)
Author:
ryan
Message:

Fix showing selected for none. Props johnbillion. fixes #13468

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r14712 r14779  
    622622            $output .= "\t<option value='0'>$show_option_all</option>\n";
    623623
    624         if ( $show_option_none )
    625             $output .= "\t<option value='-1'>$show_option_none</option>\n";
     624        if ( $show_option_none ) {
     625            $_selected = selected( -1, $selected, false );
     626            $output .= "\t<option value='-1'$_selected>$show_option_none</option>\n";
     627        }
    626628
    627629        foreach ( (array) $users as $user ) {
    628630            $user->ID = (int) $user->ID;
    629             $_selected = $user->ID == $selected ? " selected='selected'" : '';
     631            $_selected = selected( $user->ID, $selected, false );
    630632            $display = !empty($user->$show) ? $user->$show : '('. $user->user_login . ')';
    631633            $output .= "\t<option value='$user->ID'$_selected>" . esc_html($display) . "</option>\n";
Note: See TracChangeset for help on using the changeset viewer.