diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 8e2b41411f..af88fe023f 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -2685,7 +2685,7 @@ function wp_opcache_invalidate_directory( $dir ) { * with sub-directories represented as nested arrays. * @param string $path Absolute path to the directory. */ - $invalidate_directory = function( $dirlist, $path ) use ( &$invalidate_directory ) { + $invalidate_directory = static function( $dirlist, $path ) use ( &$invalidate_directory ) { $path = trailingslashit( $path ); foreach ( $dirlist as $name => $details ) { diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 159af66331..3bdcdcc452 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -485,7 +485,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) { * * @return string Returns the block content. */ - $settings['render_callback'] = function( $attributes, $content, $block ) use ( $template_path ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + $settings['render_callback'] = static function( $attributes, $content, $block ) use ( $template_path ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable ob_start(); require $template_path; return ob_get_clean(); diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index c1f43cf271..6b9e9d0bb8 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -4826,7 +4826,7 @@ class WP_Query { * $value is passed by reference to allow it to be modified. * array_walk_recursive() does not return an array. */ - function ( &$value ) use ( $wpdb, $placeholder ) { + static function ( &$value ) use ( $wpdb, $placeholder ) { if ( is_string( $value ) && str_contains( $value, $placeholder ) ) { $value = $wpdb->remove_placeholder_escape( $value ); } diff --git a/wp-includes/kses.php b/wp-includes/kses.php index 31dc1125ec..0ab8c3350d 100644 --- a/wp-includes/kses.php +++ b/wp-includes/kses.php @@ -1177,7 +1177,7 @@ function wp_kses_attr( $element, $attr, $allowed_html, $allowed_protocols ) { // Check if there are attributes that are required. $required_attrs = array_filter( $allowed_html[ $element_low ], - function( $required_attr_limits ) { + static function( $required_attr_limits ) { return isset( $required_attr_limits['required'] ) && true === $required_attr_limits['required']; } ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php index c50dded161..59edfa5bcd 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php @@ -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 ) ); }, ), diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php index 775d805efe..18b2c8fcfd 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php @@ -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 ) { diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b611292dcb..786e18f6d4 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -2405,7 +2405,7 @@ function wp_common_block_scripts_and_styles() { function wp_filter_out_block_nodes( $nodes ) { return array_filter( $nodes, - function( $node ) { + static function( $node ) { return ! in_array( 'blocks', $node['path'], true ); }, ARRAY_FILTER_USE_BOTH @@ -2635,7 +2635,7 @@ function enqueue_block_styles_assets() { if ( wp_should_load_separate_core_block_assets() ) { add_filter( 'render_block', - function( $html, $block ) use ( $block_name, $style_properties ) { + static function( $html, $block ) use ( $block_name, $style_properties ) { if ( $block['blockName'] === $block_name ) { wp_enqueue_style( $style_properties['style_handle'] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6b6dd885eb..128cc0f893 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55821'; +$wp_version = '6.3-alpha-55822'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.