Skip to content

Commit 57fb937

Browse files
Date/Time: Add indication of site language default date/time format in General Settings.
This aims to make it easier to determine which format is the default for the current locale. Props pbearne, SergeyBiryukov. Fixes #64102. git-svn-id: https://develop.svn.wordpress.org/trunk@60942 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bb4d870 commit 57fb937

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/wp-admin/options-general.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,20 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
479479

480480
foreach ( $date_formats as $format ) {
481481
echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
482+
482483
if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
483484
echo " checked='checked'";
484485
$custom = false;
485486
}
486-
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
487+
488+
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
489+
'<code>' . esc_html( $format ) . '</code>';
490+
491+
if ( __( 'F j, Y' ) === $format ) {
492+
echo ' ' . __( '(Site language default)' );
493+
}
494+
495+
echo "</label><br />\n";
487496
}
488497

489498
echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
@@ -524,11 +533,20 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
524533

525534
foreach ( $time_formats as $format ) {
526535
echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
536+
527537
if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "===".
528538
echo " checked='checked'";
529539
$custom = false;
530540
}
531-
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
541+
542+
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
543+
'<code>' . esc_html( $format ) . '</code>';
544+
545+
if ( __( 'g:i a' ) === $format ) {
546+
echo ' ' . __( '(Site language default)' );
547+
}
548+
549+
echo "</label><br />\n";
532550
}
533551

534552
echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';

0 commit comments

Comments
 (0)