Skip to content

Commit

Permalink
Date/Time: Add d.m.Y to date format presets on General Settings scr…
Browse files Browse the repository at this point in the history
…een.

This gives users another option when selecting how dates are displayed on their site. This change is relevant for better localization, providing more date format choices for users in regions where this format is common.

The `array_unique()` call ensures that if this format was already added by a plugin or theme, it won't be duplicated.

Follow-up to [9131], [22299], [28820], [28848].

Props Daedalon, pbearne, fierevere, im3dabasia1, SergeyBiryukov.
Fixes #55685.

git-svn-id: https://develop.svn.wordpress.org/trunk@59475 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Dec 1, 2024
1 parent ad9505b commit cc5c5b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wp-admin/options-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,12 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
* Filters the default date formats.
*
* @since 2.7.0
* @since 4.0.0 Added ISO date standard YYYY-MM-DD format.
* @since 4.0.0 Replaced the `Y/m/d` format with `Y-m-d` (ISO date standard YYYY-MM-DD).
* @since 6.8.0 Added the `d.m.Y` format.
*
* @param string[] $default_date_formats Array of default date formats.
*/
$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) );
$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y', 'd.m.Y' ) ) );

$custom = true;

Expand Down

0 comments on commit cc5c5b8

Please sign in to comment.