Make WordPress Core

Changeset 59475


Ignore:
Timestamp:
12/01/2024 06:37:02 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

Date/Time: Add d.m.Y to date format presets on General Settings screen.

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.

File:
1 edited

Legend:

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

    r58927 r59475  
    477477     *
    478478     * @since 2.7.0
    479      * @since 4.0.0 Added ISO date standard YYYY-MM-DD format.
     479     * @since 4.0.0 Replaced the `Y/m/d` format with `Y-m-d` (ISO date standard YYYY-MM-DD).
     480     * @since 6.8.0 Added the `d.m.Y` format.
    480481     *
    481482     * @param string[] $default_date_formats Array of default date formats.
    482483     */
    483     $date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) );
     484    $date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y', 'd.m.Y' ) ) );
    484485
    485486    $custom = true;
Note: See TracChangeset for help on using the changeset viewer.