diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index f97cac5d33..48b6e7587a 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -323,6 +323,15 @@ function wp_default_packages_inline_scripts( $scripts ) { ) ); + // Calculate the timezone abbr (EDT, PST) if possible. + $timezone_string = get_option( 'timezone_string', 'UTC' ); + $timezone_abbr = ''; + + if ( ! empty( $timezone_string ) ) { + $timezone_date = new DateTime( null, new DateTimeZone( $timezone_string ) ); + $timezone_abbr = $timezone_date->format( 'T' ); + } + $scripts->add_inline_script( 'wp-date', sprintf( @@ -355,7 +364,8 @@ function wp_default_packages_inline_scripts( $scripts ) { ), 'timezone' => array( 'offset' => get_option( 'gmt_offset', 0 ), - 'string' => get_option( 'timezone_string', 'UTC' ), + 'string' => $timezone_string, + 'abbr' => $timezone_abbr, ), ) ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 26d3e23880..584b6ae5d3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-49082'; +$wp_version = '5.6-alpha-49083'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.