Changeset 55822
- Timestamp:
- 05/17/2023 10:44:21 PM (17 months ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r55750 r55822 2686 2686 * @param string $path Absolute path to the directory. 2687 2687 */ 2688 $invalidate_directory = function( $dirlist, $path ) use ( &$invalidate_directory ) {2688 $invalidate_directory = static function( $dirlist, $path ) use ( &$invalidate_directory ) { 2689 2689 $path = trailingslashit( $path ); 2690 2690 -
trunk/src/wp-includes/blocks.php
r55762 r55822 486 486 * @return string Returns the block content. 487 487 */ 488 $settings['render_callback'] = function( $attributes, $content, $block ) use ( $template_path ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable488 $settings['render_callback'] = static function( $attributes, $content, $block ) use ( $template_path ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable 489 489 ob_start(); 490 490 require $template_path; -
trunk/src/wp-includes/class-wp-query.php
r55749 r55822 4827 4827 * array_walk_recursive() does not return an array. 4828 4828 */ 4829 function ( &$value ) use ( $wpdb, $placeholder ) {4829 static function ( &$value ) use ( $wpdb, $placeholder ) { 4830 4830 if ( is_string( $value ) && str_contains( $value, $placeholder ) ) { 4831 4831 $value = $wpdb->remove_placeholder_escape( $value ); -
trunk/src/wp-includes/kses.php
r55703 r55822 1178 1178 $required_attrs = array_filter( 1179 1179 $allowed_html[ $element_low ], 1180 function( $required_attr_limits ) {1180 static function( $required_attr_limits ) { 1181 1181 return isset( $required_attr_limits['required'] ) && true === $required_attr_limits['required']; 1182 1182 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php
r53760 r55822 793 793 'context' => array( 'view', 'edit', 'embed' ), 794 794 'arg_options' => array( 795 'sanitize_callback' => function ( $value ) {795 'sanitize_callback' => static function ( $value ) { 796 796 return array_map( 'sanitize_html_class', wp_parse_list( $value ) ); 797 797 }, … … 874 874 'context' => array( 'view', 'edit', 'embed' ), 875 875 'arg_options' => array( 876 'sanitize_callback' => function ( $value ) {876 'sanitize_callback' => static function ( $value ) { 877 877 return array_map( 'sanitize_html_class', wp_parse_list( $value ) ); 878 878 }, -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php
r53760 r55822 535 535 'context' => array( 'view', 'edit' ), 536 536 'arg_options' => array( 537 'validate_callback' => function ( $locations, $request, $param ) {537 'validate_callback' => static function ( $locations, $request, $param ) { 538 538 $valid = rest_validate_request_arg( $locations, $request, $param ); 539 539 -
trunk/src/wp-includes/script-loader.php
r55820 r55822 2406 2406 return array_filter( 2407 2407 $nodes, 2408 function( $node ) {2408 static function( $node ) { 2409 2409 return ! in_array( 'blocks', $node['path'], true ); 2410 2410 }, … … 2636 2636 add_filter( 2637 2637 'render_block', 2638 function( $html, $block ) use ( $block_name, $style_properties ) {2638 static function( $html, $block ) use ( $block_name, $style_properties ) { 2639 2639 if ( $block['blockName'] === $block_name ) { 2640 2640 wp_enqueue_style( $style_properties['style_handle'] ); -
trunk/tests/performance/wp-content/mu-plugins/server-timing.php
r55459 r55822 3 3 add_action( 4 4 'template_redirect', 5 function() {5 static function() { 6 6 7 7 global $timestart; … … 16 16 add_action( 17 17 'shutdown', 18 function() use ( $server_timing_values, $template_start ) {18 static function() use ( $server_timing_values, $template_start ) { 19 19 20 20 global $timestart; -
trunk/tests/phpunit/tests/admin/wpSiteHealth.php
r55029 r55822 422 422 add_filter( 423 423 'site_status_persistent_object_cache_thresholds', 424 function() {424 static function() { 425 425 return array( 426 426 'alloptions_count' => PHP_INT_MAX, … … 473 473 add_filter( 474 474 'site_status_persistent_object_cache_thresholds', 475 function ( $thresholds ) use ( $threshold, $count ) {475 static function ( $thresholds ) use ( $threshold, $count ) { 476 476 return array_merge( $thresholds, array( $threshold => $count ) ); 477 477 } -
trunk/tests/phpunit/tests/blocks/editor.php
r55457 r55822 303 303 add_filter( 304 304 'upload_size_limit', 305 function() {305 static function() { 306 306 return 500; 307 307 } -
trunk/tests/phpunit/tests/blocks/renderCommentTemplate.php
r55457 r55822 437 437 ); 438 438 439 $commenter_filter = function () {439 $commenter_filter = static function () { 440 440 return array( 441 441 'comment_author_email' => 'unapproved@example.org', -
trunk/tests/phpunit/tests/blocks/wpBlock.php
r55457 r55822 694 694 'core/outer', 695 695 array( 696 'render_callback' => function( $block_attributes, $content ) {696 'render_callback' => static function( $block_attributes, $content ) { 697 697 return $content; 698 698 }, … … 703 703 'core/inner', 704 704 array( 705 'render_callback' => function() {705 'render_callback' => static function() { 706 706 return 'b'; 707 707 }, -
trunk/tests/phpunit/tests/dependencies/scripts.php
r55084 r55822 1474 1474 1475 1475 $print_scripts = get_echo( 1476 function() {1476 static function() { 1477 1477 wp_print_scripts(); 1478 1478 _print_scripts(); -
trunk/tests/phpunit/tests/general/wpPreloadResources.php
r53849 r55822 15 15 */ 16 16 public function test_preload_resources( $expected, $preload_resources ) { 17 $callback = function () use ( $preload_resources ) {17 $callback = static function () use ( $preload_resources ) { 18 18 return $preload_resources; 19 19 }; -
trunk/tests/phpunit/tests/kses.php
r55564 r55822 1924 1924 1925 1925 return array_map( 1926 function ( $datum ) {1926 static function ( $datum ) { 1927 1927 $datum[] = array( 1928 1928 'p' => array( -
trunk/tests/phpunit/tests/media.php
r55821 r55822 2349 2349 add_filter( 2350 2350 'wp_content_img_tag', 2351 function( $filtered_image ) {2351 static function( $filtered_image ) { 2352 2352 return "<span>$filtered_image</span>"; 2353 2353 } … … 2373 2373 add_filter( 2374 2374 'wp_content_img_tag', 2375 function( $filtered_image ) {2375 static function( $filtered_image ) { 2376 2376 return "<span>$filtered_image</span>"; 2377 2377 } … … 3762 3762 add_filter( 3763 3763 'wp_get_attachment_image_attributes', 3764 function( $attr ) {3764 static function( $attr ) { 3765 3765 unset( $attr['srcset'], $attr['sizes'], $attr['decoding'] ); 3766 3766 return $attr; -
trunk/tests/phpunit/tests/pluggable/wpMail.php
r55087 r55822 539 539 */ 540 540 public function test_wp_mail_resets_properties() { 541 $wp_mail_set_text_message = function ( $phpmailer ) {541 $wp_mail_set_text_message = static function ( $phpmailer ) { 542 542 $phpmailer->AltBody = 'user1'; 543 543 }; -
trunk/tests/phpunit/tests/query/stickies.php
r52990 r55822 137 137 add_filter( 138 138 'pre_option_sticky_posts', 139 function () use ( $post_ids ) {139 static function () use ( $post_ids ) { 140 140 return $post_ids; 141 141 } -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r55562 r55822 938 938 */ 939 939 public function test_link_embedding_returning_wp_error() { 940 $return_wp_error = function() {940 $return_wp_error = static function() { 941 941 return new WP_Error( 'some-error', 'This is not valid!' ); 942 942 }; … … 2189 2189 array( 2190 2190 'methods' => \WP_REST_Server::READABLE, 2191 'callback' => function() {2191 'callback' => static function() { 2192 2192 return new \WP_REST_Response( INF ); 2193 2193 }, -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r55457 r55822 1385 1385 sprintf( '/themes/(?P<stylesheet>%s)//test', WP_REST_Themes_Controller::PATTERN ), 1386 1386 array( 1387 'callback' => function ( WP_REST_Request $request ) {1387 'callback' => static function ( WP_REST_Request $request ) { 1388 1388 return $request['stylesheet']; 1389 1389 }, -
trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r55753 r55822 601 601 add_filter( 602 602 'query', 603 function( $query ) use ( &$global_styles_query_count ) {603 static function( $query ) use ( &$global_styles_query_count ) { 604 604 if ( preg_match( '#post_type = \'wp_global_styles\'#', $query ) ) { 605 605 $global_styles_query_count++;
Note: See TracChangeset
for help on using the changeset viewer.