WordPress.org

Make WordPress Core

Ticket #13468: 13468-2.patch

File 13468-2.patch, 947 bytes (added by johnbillion, 8 years ago)
  • wp-includes/user.php

     
    621621                if ( $show_option_all )
    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";
    632634                }