Make WordPress Core


Ignore:
Timestamp:
08/26/2021 12:57:08 PM (3 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Use static closures when not using $this.

When a closure does not use $this, it can be made static for improved performance.

Static closures are supported in PHP since PHP 5.4. ​

Props jrf, hellofromTonya, swissspidy, SergeyBiryukov.
See #53359.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/layout.php

    r51301 r51657  
    132132    $updated_content = preg_replace_callback(
    133133        $replace_regex,
    134         function( $matches ) {
     134        static function( $matches ) {
    135135            return $matches[1] . '<div class="wp-block-group__inner-container">' . $matches[2] . '</div>' . $matches[3];
    136136        },
Note: See TracChangeset for help on using the changeset viewer.