Make WordPress Core


Ignore:
Timestamp:
05/17/2023 10:44:21 PM (19 months 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/rest-api/rest-themes-controller.php

    r55457 r55822  
    13851385            sprintf( '/themes/(?P<stylesheet>%s)//test', WP_REST_Themes_Controller::PATTERN ),
    13861386            array(
    1387                 'callback'            => function ( WP_REST_Request $request ) {
     1387                'callback'            => static function ( WP_REST_Request $request ) {
    13881388                    return $request['stylesheet'];
    13891389                },
Note: See TracChangeset for help on using the changeset viewer.