Make WordPress Core


Ignore:
Timestamp:
05/17/2023 10:44:21 PM (17 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/src/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php

    r53760 r55822  
    535535            'context'     => array( 'view', 'edit' ),
    536536            'arg_options' => array(
    537                 'validate_callback' => function ( $locations, $request, $param ) {
     537                'validate_callback' => static function ( $locations, $request, $param ) {
    538538                    $valid = rest_validate_request_arg( $locations, $request, $param );
    539539
Note: See TracChangeset for help on using the changeset viewer.