Make WordPress Core

Ticket #60640: 60640.diff

File 60640.diff, 620 bytes (added by bhargavbhandari90, 8 months ago)

Use "selected" function for weekdays dropdown selected

  • src/wp-admin/options-general.php

     
    521521global $wp_locale;
    522522
    523523for ( $day_index = 0; $day_index <= 6; $day_index++ ) :
    524         $selected = ( get_option( 'start_of_week' ) == $day_index ) ? 'selected="selected"' : '';
     524        $selected = selected( get_option( 'start_of_week' ), $day_index, false );
    525525        echo "\n\t<option value='" . esc_attr( $day_index ) . "' $selected>" . $wp_locale->get_weekday( $day_index ) . '</option>';
    526526endfor;
    527527?>