Skip to content

Commit

Permalink
Editor: Ensure that timezone.offset passed to @wordpress/date is …
Browse files Browse the repository at this point in the history
…a float

Fixes inconsistent type of `timezone.offset` passed to `@wordpress/date`. It
should always be a float, never a string.

Props talldanwp.
Fixes #56459.


git-svn-id: https://develop.svn.wordpress.org/trunk@53956 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
noisysocks committed Aug 30, 2022
1 parent d1c7387 commit 3d168f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ function wp_default_packages_inline_scripts( $scripts ) {
'datetimeAbbreviated' => __( 'M j, Y g:i a' ),
),
'timezone' => array(
'offset' => get_option( 'gmt_offset', 0 ),
'offset' => (float) get_option( 'gmt_offset', 0 ),
'string' => $timezone_string,
'abbr' => $timezone_abbr,
),
Expand Down

0 comments on commit 3d168f6

Please sign in to comment.