Make WordPress Core

Ticket #50624: 50624.patch

File 50624.patch, 985 bytes (added by mkaz, 3 years ago)
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index f0404830bd..b4d7885f23 100644
    a b function wp_default_packages_inline_scripts( $scripts ) { 
    322322                )
    323323        );
    324324
     325        // Calculate the timezone abbr (EDT, PST) if possible.
     326        $timezone_string = get_option( 'timezone_string', 'UTC' );
     327        $timezone_abbr   = '';
     328
     329        if ( ! empty( $timezone_string ) ) {
     330                $timezone_date = new DateTime( null, new DateTimeZone( $timezone_string ) );
     331                $timezone_abbr = $timezone_date->format( 'T' );
     332        }
     333
    325334        $scripts->add_inline_script(
    326335                'wp-date',
    327336                sprintf(
    function wp_default_packages_inline_scripts( $scripts ) { 
    354363                                        ),
    355364                                        'timezone' => array(
    356365                                                'offset' => get_option( 'gmt_offset', 0 ),
    357                                                 'string' => get_option( 'timezone_string', 'UTC' ),
     366                                                'string' => $timezone_string,
     367                                                'abbr'   => $timezone_abbr,
    358368                                        ),
    359369                                )
    360370                        )