Make WordPress Core


Ignore:
Timestamp:
02/08/2024 07:06:02 AM (15 months ago)
Author:
youknowriad
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r57492 r57556  
    419419        $timezone_abbr = $timezone_date->format( 'T' );
    420420    }
     421
     422    $gmt_offset = get_option( 'gmt_offset', 0 );
    421423
    422424    $scripts->add_inline_script(
     
    476478                    ),
    477479                    'timezone' => array(
    478                         'offset' => (float) get_option( 'gmt_offset', 0 ),
    479                         'string' => $timezone_string,
    480                         'abbr'   => $timezone_abbr,
     480                        'offset'          => (float) $gmt_offset,
     481                        'offsetFormatted' => str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), (string) $gmt_offset ),
     482                        'string'          => $timezone_string,
     483                        'abbr'            => $timezone_abbr,
    481484                    ),
    482485                )
Note: See TracChangeset for help on using the changeset viewer.