Make WordPress Core


Ignore:
Timestamp:
09/12/2022 05:50:36 PM (22 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Replace deprecated string interpolation patterns.

PHP 8.2 deprecates string interpolation patterns that place the dollar sign outside the curly braces:

echo "Hello ${name}";

This commit fixes such patterns by replacing them with proper curly braced patterns:

echo "Hello {$name}";

This addresses Deprecated: Using ${var} in strings is deprecated, use {$var} instead notices when running tests on PHP 8.2.

References:

Follow-up to [10584], [31733], [42360], [53922].

Props ayeshrajans, jrf.
Fixes #55787.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r53888 r54134  
    17391739
    17401740        foreach ( $data_attributes as $name => $value ) {
    1741             $data_attribute_string .= " data-${name}=\"" . esc_attr( $value ) . '"';
     1741            $data_attribute_string .= " data-{$name}=\"" . esc_attr( $value ) . '"';
    17421742        }
    17431743
Note: See TracChangeset for help on using the changeset viewer.