mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Code Modernization: Pass correct default value to new DateTime() in wp_default_packages_inline_scripts().
This fixes a "Deprecated: `DateTime::__construct()`: Passing null to parameter #1 (`$datetime`) of type string is deprecated" warning on PHP 8.1. Follow-up to [49083]. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51533 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9f3c2be1d0
commit
a5de731f9e
@ -330,7 +330,7 @@ function wp_default_packages_inline_scripts( $scripts ) {
|
||||
$timezone_abbr = '';
|
||||
|
||||
if ( ! empty( $timezone_string ) ) {
|
||||
$timezone_date = new DateTime( null, new DateTimeZone( $timezone_string ) );
|
||||
$timezone_date = new DateTime( 'now', new DateTimeZone( $timezone_string ) );
|
||||
$timezone_abbr = $timezone_date->format( 'T' );
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user