Script Loader: Add a timezone offset display value to wp.date.setSettings.
Fixes a bug in the editor where the offset values are displayed as decimals rather than minutes. Props afercia, get_dave. Fixes #60105. Built from https://develop.svn.wordpress.org/trunk@57556 git-svn-id: http://core.svn.wordpress.org/trunk@57057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
15ab0f672f
commit
cd2716ff72
|
@ -419,6 +419,8 @@ function wp_default_packages_inline_scripts( $scripts ) {
|
|||
$timezone_abbr = $timezone_date->format( 'T' );
|
||||
}
|
||||
|
||||
$gmt_offset = get_option( 'gmt_offset', 0 );
|
||||
|
||||
$scripts->add_inline_script(
|
||||
'wp-date',
|
||||
sprintf(
|
||||
|
@ -475,9 +477,10 @@ function wp_default_packages_inline_scripts( $scripts ) {
|
|||
'datetimeAbbreviated' => __( 'M j, Y g:i a' ),
|
||||
),
|
||||
'timezone' => array(
|
||||
'offset' => (float) get_option( 'gmt_offset', 0 ),
|
||||
'string' => $timezone_string,
|
||||
'abbr' => $timezone_abbr,
|
||||
'offset' => (float) $gmt_offset,
|
||||
'offsetFormatted' => str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), (string) $gmt_offset ),
|
||||
'string' => $timezone_string,
|
||||
'abbr' => $timezone_abbr,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.5-alpha-57555';
|
||||
$wp_version = '6.5-alpha-57556';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue