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.
Built from https://develop.svn.wordpress.org/trunk@60942


git-svn-id: http://core.svn.wordpress.org/trunk@60278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-10-16 00:06:32 +00:00
parent 7c4b25b036
commit 8eddfadd6f
2 changed files with 21 additions and 3 deletions

View File

@@ -479,11 +479,20 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
foreach ( $date_formats as $format ) {
echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
echo " checked='checked'";
$custom = false;
}
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
'<code>' . esc_html( $format ) . '</code>';
if ( __( 'F j, Y' ) === $format ) {
echo ' ' . __( '(Site language default)' );
}
echo "</label><br />\n";
}
echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
@@ -524,11 +533,20 @@ foreach ( $date_formats as $format ) {
foreach ( $time_formats as $format ) {
echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "===".
echo " checked='checked'";
$custom = false;
}
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
'<code>' . esc_html( $format ) . '</code>';
if ( __( 'g:i a' ) === $format ) {
echo ' ' . __( '(Site language default)' );
}
echo "</label><br />\n";
}
echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60941';
$wp_version = '6.9-alpha-60942';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.