mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
General: Use static on closures whenever $this is not used to avoid memory leaks.
Props westonruter, jrf, spacedmonkey. Fixes #58323. git-svn-id: https://develop.svn.wordpress.org/trunk@55822 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -792,7 +792,7 @@ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller {
|
||||
),
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => function ( $value ) {
|
||||
'sanitize_callback' => static function ( $value ) {
|
||||
return array_map( 'sanitize_html_class', wp_parse_list( $value ) );
|
||||
},
|
||||
),
|
||||
@@ -873,7 +873,7 @@ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller {
|
||||
),
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => function ( $value ) {
|
||||
'sanitize_callback' => static function ( $value ) {
|
||||
return array_map( 'sanitize_html_class', wp_parse_list( $value ) );
|
||||
},
|
||||
),
|
||||
|
||||
@@ -534,7 +534,7 @@ class WP_REST_Menus_Controller extends WP_REST_Terms_Controller {
|
||||
),
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'validate_callback' => function ( $locations, $request, $param ) {
|
||||
'validate_callback' => static function ( $locations, $request, $param ) {
|
||||
$valid = rest_validate_request_arg( $locations, $request, $param );
|
||||
|
||||
if ( true !== $valid ) {
|
||||
|
||||
Reference in New Issue
Block a user