Make WordPress Core

Ticket #46596: 46596.diff

File 46596.diff, 950 bytes (added by dlh, 6 years ago)
  • src/wp-includes/customize/class-wp-customize-date-time-control.php

    diff --git src/wp-includes/customize/class-wp-customize-date-time-control.php src/wp-includes/customize/class-wp-customize-date-time-control.php
    index 6325194395..42052b77b9 100644
    class WP_Customize_Date_Time_Control extends WP_Customize_Control { 
    100100                $timezone_info = $this->get_timezone_info();
    101101
    102102                $date_format = get_option( 'date_format' );
     103
     104                /*
     105                 * Special handling for 'S' so that it doesn't appear in the control but
     106                 * also isn't replaced with a placeholder below. See #46596.
     107                 */
     108                $date_format = str_replace( 'jS', 'j', $date_format );
    103109                $date_format = preg_replace( '/(?<!\\\\)[Yyo]/', '%1$s', $date_format );
    104110                $date_format = preg_replace( '/(?<!\\\\)[FmMn]/', '%2$s', $date_format );
    105111                $date_format = preg_replace( '/(?<!\\\\)[jd]/', '%3$s', $date_format );