Make WordPress Core


Ignore:
Timestamp:
05/17/2023 10:44:21 PM (3 years ago)
Author:
westonruter
Message:

General: Use static on closures whenever $this is not used to avoid memory leaks.

Props westonruter, jrf, spacedmonkey.
Fixes #58323.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/wpBlock.php

    r55457 r55822  
    694694            'core/outer',
    695695            array(
    696                 'render_callback' => function( $block_attributes, $content ) {
     696                'render_callback' => static function( $block_attributes, $content ) {
    697697                    return $content;
    698698                },
     
    703703            'core/inner',
    704704            array(
    705                 'render_callback' => function() {
     705                'render_callback' => static function() {
    706706                    return 'b';
    707707                },
Note: See TracChangeset for help on using the changeset viewer.