Make WordPress Core

Changeset 51533


Ignore:
Timestamp:
08/03/2021 12:03:41 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r51525 r51533  
    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    }
Note: See TracChangeset for help on using the changeset viewer.