Make WordPress Core


Ignore:
Timestamp:
11/10/2025 08:40:33 PM (11 months ago)
Author:
desrosj
Message:

Date/Time: Revert [60942].

The changes in [60942] aimed to add an indicator next to the default date and time formats for the site’s locale in General Settings. However, the changes do not take into account the fact that a user may have a different language than the site’s default selected as their preference.

Props swissspidy, johnbillion, SergeyBiryukov, pbearne, desrosj, wildworks.
See #64102.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options-general.php

    r61133 r61193  
    481481foreach ( $date_formats as $format ) {
    482482        echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
    483 
    484483        if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
    485484                echo " checked='checked'";
    486485                $custom = false;
    487486        }
    488 
    489         echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
    490                 '<code>' . esc_html( $format ) . '</code>';
    491 
    492         if ( __( 'F j, Y' ) === $format ) {
    493                 echo ' ' . __( '(Site language default)' );
    494         }
    495 
    496         echo "</label><br />\n";
     487        echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
    497488}
    498489
    … …  
    535526foreach ( $time_formats as $format ) {
    536527        echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
    537 
    538528        if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "===".
    539529                echo " checked='checked'";
    540530                $custom = false;
    541531        }
    542 
    543         echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
    544                 '<code>' . esc_html( $format ) . '</code>';
    545 
    546         if ( __( 'g:i a' ) === $format ) {
    547                 echo ' ' . __( '(Site language default)' );
    548         }
    549 
    550         echo "</label><br />\n";
     532        echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
    551533}
    552534
Note: See TracChangeset for help on using the changeset viewer.