Skip to content

Commit a5de731

Browse files
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
1 parent 9f3c2be commit a5de731

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/script-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ function wp_default_packages_inline_scripts( $scripts ) {
330330
$timezone_abbr = '';
331331

332332
if ( ! empty( $timezone_string ) ) {
333-
$timezone_date = new DateTime( null, new DateTimeZone( $timezone_string ) );
333+
$timezone_date = new DateTime( 'now', new DateTimeZone( $timezone_string ) );
334334
$timezone_abbr = $timezone_date->format( 'T' );
335335
}
336336

0 commit comments

Comments
 (0)