Changeset 51657
- Timestamp:
- 08/26/2021 12:57:08 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 54 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-blocks.php
r51595 r51657 32 32 add_filter( 33 33 'admin_body_class', 34 function( $classes ) {34 static function( $classes ) { 35 35 return "$classes is-fullscreen-mode"; 36 36 } -
trunk/src/wp-admin/includes/class-wp-community-events.php
r49929 r51657 475 475 $future_wordcamps = array_filter( 476 476 $future_events, 477 function( $wordcamp ) {477 static function( $wordcamp ) { 478 478 return 'wordcamp' === $wordcamp['type']; 479 479 } -
trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php
r50979 r51657 42 42 $tests = array_filter( $tests ); 43 43 $tests = array_map( 44 function( $test ) {44 static function( $test ) { 45 45 $test = (object) $test; 46 46 -
trunk/src/wp-admin/includes/update-core.php
r51521 r51657 1659 1659 $dirs = array_filter( 1660 1660 $dirs, 1661 function( $dir ) {1661 static function( $dir ) { 1662 1662 // Skip any node_modules directories. 1663 1663 return false === strpos( $dir, 'node_modules' ); -
trunk/src/wp-admin/options-privacy.php
r50631 r51657 21 21 add_filter( 22 22 'admin_body_class', 23 function( $body_class ) {23 static function( $body_class ) { 24 24 $body_class .= ' privacy-settings '; 25 25 -
trunk/src/wp-admin/privacy-policy-guide.php
r50161 r51657 20 20 add_filter( 21 21 'admin_body_class', 22 function( $body_class ) {22 static function( $body_class ) { 23 23 $body_class .= ' privacy-settings '; 24 24 -
trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php
r51322 r51657 187 187 'description' => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ), 188 188 'mode' => 'hue', 189 'active_callback' => function() use ( $wp_customize ) {189 'active_callback' => static function() use ( $wp_customize ) { 190 190 return ( 'custom' === $wp_customize->get_setting( 'accent_hue_active' )->value() ); 191 191 }, -
trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php
r51294 r51657 93 93 'capability' => 'edit_theme_options', 94 94 'default' => 'excerpt', 95 'sanitize_callback' => function( $value ) {95 'sanitize_callback' => static function( $value ) { 96 96 return 'excerpt' === $value || 'full' === $value ? $value : 'excerpt'; 97 97 }, -
trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php
r51294 r51657 154 154 'section' => 'colors', 155 155 'priority' => 100, 156 'active_callback' => function() {156 'active_callback' => static function() { 157 157 return 127 >= Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( get_theme_mod( 'background_color', 'D1E4DD' ) ); 158 158 }, … … 166 166 'capability' => 'edit_theme_options', 167 167 'default' => false, 168 'sanitize_callback' => function( $value ) {168 'sanitize_callback' => static function( $value ) { 169 169 return (bool) $value; 170 170 }, … … 189 189 'priority' => 110, 190 190 'description' => $description, 191 'active_callback' => function( $value ) {191 'active_callback' => static function( $value ) { 192 192 return 127 < Twenty_Twenty_One_Custom_Colors::get_relative_luminance_from_hex( get_theme_mod( 'background_color', 'D1E4DD' ) ); 193 193 }, -
trunk/src/wp-includes/block-supports/duotone.php
r50929 r51657 362 362 $selectors = explode( ',', $duotone_support ); 363 363 $selectors_scoped = array_map( 364 function ( $selector ) use ( $duotone_id ) {364 static function ( $selector ) use ( $duotone_id ) { 365 365 return '.' . $duotone_id . ' ' . trim( $selector ); 366 366 }, -
trunk/src/wp-includes/block-supports/layout.php
r51301 r51657 132 132 $updated_content = preg_replace_callback( 133 133 $replace_regex, 134 function( $matches ) {134 static function( $matches ) { 135 135 return $matches[1] . '<div class="wp-block-group__inner-container">' . $matches[2] . '</div>' . $matches[3]; 136 136 }, -
trunk/src/wp-includes/block-template.php
r51321 r51657 125 125 usort( 126 126 $templates, 127 function ( $template_a, $template_b ) use ( $slug_priorities ) {127 static function ( $template_a, $template_b ) use ( $slug_priorities ) { 128 128 return $slug_priorities[ $template_a->slug ] - $slug_priorities[ $template_b->slug ]; 129 129 } -
trunk/src/wp-includes/class-wp-theme-json.php
r51538 r51657 637 637 $declaration_block = array_reduce( 638 638 $declarations, 639 function ( $carry, $element ) {639 static function ( $carry, $element ) { 640 640 return $carry .= $element['name'] . ': ' . $element['value'] . ';'; }, 641 641 '' -
trunk/src/wp-includes/formatting.php
r51624 r51657 3114 3114 $text = preg_replace_callback( 3115 3115 '|<a (.+?)>|i', 3116 function( $matches ) {3116 static function( $matches ) { 3117 3117 return wp_rel_callback( $matches, 'nofollow' ); 3118 3118 }, … … 3148 3148 $text = preg_replace_callback( 3149 3149 '|<a (.+?)>|i', 3150 function( $matches ) {3150 static function( $matches ) { 3151 3151 return wp_rel_callback( $matches, 'nofollow ugc' ); 3152 3152 }, -
trunk/src/wp-includes/rest-api.php
r51648 r51657 3228 3228 $status = array_reduce( 3229 3229 $error->get_all_error_data(), 3230 function ( $status, $error_data ) {3230 static function ( $status, $error_data ) { 3231 3231 return is_array( $error_data ) && isset( $error_data['status'] ) ? $error_data['status'] : $status; 3232 3232 }, -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
r51278 r51657 598 598 return array_reduce( 599 599 $requested_fields, 600 function( $response_fields, $field ) use ( $fields ) {600 static function( $response_fields, $field ) use ( $fields ) { 601 601 if ( in_array( $field, $fields, true ) ) { 602 602 $response_fields[] = $field; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php
r51289 r51657 382 382 383 383 $language_packs = array_map( 384 function( $item ) {384 static function( $item ) { 385 385 return (object) $item; 386 386 }, … … 390 390 $language_packs = array_filter( 391 391 $language_packs, 392 function( $pack ) use ( $installed_locales ) {392 static function( $pack ) use ( $installed_locales ) { 393 393 return in_array( $pack->language, $installed_locales, true ); 394 394 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php
r51286 r51657 86 86 'description' => __( 'Serialized widget form data to encode into instance settings.' ), 87 87 'type' => 'string', 88 'sanitize_callback' => function( $string ) {88 'sanitize_callback' => static function( $string ) { 89 89 $array = array(); 90 90 wp_parse_str( $string, $array ); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php
r51432 r51657 793 793 'context' => array(), 794 794 'arg_options' => array( 795 'sanitize_callback' => function( $string ) {795 'sanitize_callback' => static function( $string ) { 796 796 $array = array(); 797 797 wp_parse_str( $string, $array ); -
trunk/src/wp-includes/script-loader.php
r51551 r51657 2693 2693 usort( 2694 2694 $styles, 2695 function( $a, $b ) {2695 static function( $a, $b ) { 2696 2696 return ( $a['size'] <= $b['size'] ) ? -1 : 1; 2697 2697 } -
trunk/src/wp-includes/update.php
r50921 r51657 518 518 } 519 519 520 $sanitize_plugin_update_payload = function( &$item ) {520 $sanitize_plugin_update_payload = static function( &$item ) { 521 521 $item = (object) $item; 522 522 -
trunk/src/wp-includes/user.php
r51410 r51657 3460 3460 $extra_data = array_filter( 3461 3461 $_extra_data, 3462 function( $item ) use ( $reserved_names ) {3462 static function( $item ) use ( $reserved_names ) { 3463 3463 return ! in_array( $item['name'], $reserved_names, true ); 3464 3464 } -
trunk/tests/phpunit/includes/abstract-testcase.php
r51608 r51657 720 720 $expected = map_deep( 721 721 $expected, 722 function ( $value ) {722 static function ( $value ) { 723 723 return str_replace( "\r\n", "\n", $value ); 724 724 } … … 727 727 $actual = map_deep( 728 728 $actual, 729 function ( $value ) {729 static function ( $value ) { 730 730 return str_replace( "\r\n", "\n", $value ); 731 731 } -
trunk/tests/phpunit/includes/plural-form-function.php
r48790 r51657 8 8 */ 9 9 function tests_make_plural_form_function( $nplurals, $expression ) { 10 $closure = function ( $n ) use ( $nplurals, $expression ) {10 $closure = static function ( $n ) use ( $nplurals, $expression ) { 11 11 $expression = str_replace( 'n', $n, $expression ); 12 12 -
trunk/tests/phpunit/tests/actions/closures.php
r46586 r51657 13 13 function test_action_closure() { 14 14 $tag = 'test_action_closure'; 15 $closure = function( $a, $b ) {15 $closure = static function( $a, $b ) { 16 16 $GLOBALS[ $a ] = $b; 17 17 }; … … 26 26 27 27 $tag2 = 'test_action_closure_2'; 28 $closure2 = function() {28 $closure2 = static function() { 29 29 $GLOBALS['closure_no_args'] = true; 30 30 }; -
trunk/tests/phpunit/tests/admin/includesListTable.php
r51639 r51657 361 361 add_filter( 362 362 'bulk_actions-edit-comments', 363 function() {363 static function() { 364 364 return array( 365 365 'delete' => 'Delete', -
trunk/tests/phpunit/tests/block-template-utils.php
r51079 r51657 71 71 function get_template_ids( $templates ) { 72 72 return array_map( 73 function( $template ) {73 static function( $template ) { 74 74 return $template->id; 75 75 }, -
trunk/tests/phpunit/tests/blocks/context.php
r51568 r51657 116 116 'gutenberg/contextWithoutDefault', 117 117 ), 118 'render_callback' => function( $attributes, $content, $block ) use ( &$provided_context ) {118 'render_callback' => static function( $attributes, $content, $block ) use ( &$provided_context ) { 119 119 $provided_context[] = $block->context; 120 120 … … 156 156 array( 157 157 'uses_context' => array( 'postId', 'postType' ), 158 'render_callback' => function( $attributes, $content, $block ) use ( &$provided_context ) {158 'render_callback' => static function( $attributes, $content, $block ) use ( &$provided_context ) { 159 159 $provided_context[] = $block->context; 160 160 … … 189 189 array( 190 190 'uses_context' => array( 'example' ), 191 'render_callback' => function( $attributes, $content, $block ) use ( &$provided_context ) {191 'render_callback' => static function( $attributes, $content, $block ) use ( &$provided_context ) { 192 192 $provided_context[] = $block->context; 193 193 … … 197 197 ); 198 198 199 $filter_block_context = function( $context ) {199 $filter_block_context = static function( $context ) { 200 200 $context['example'] = 'ok'; 201 201 return $context; -
trunk/tests/phpunit/tests/blocks/register.php
r51599 r51657 511 511 */ 512 512 public function test_filter_block_registration() { 513 $filter_registration = function( $args, $name ) {513 $filter_registration = static function( $args, $name ) { 514 514 $args['attributes'] = array( $name => array( 'type' => 'boolean' ) ); 515 515 return $args; … … 529 529 */ 530 530 public function test_filter_block_registration_metadata() { 531 $filter_metadata_registration = function( $metadata ) {531 $filter_metadata_registration = static function( $metadata ) { 532 532 $metadata['apiVersion'] = 3; 533 533 return $metadata; … … 547 547 */ 548 548 public function test_filter_block_registration_metadata_settings() { 549 $filter_metadata_registration = function( $settings, $metadata ) {549 $filter_metadata_registration = static function( $settings, $metadata ) { 550 550 $settings['api_version'] = $metadata['apiVersion'] + 1; 551 551 return $settings; -
trunk/tests/phpunit/tests/blocks/supportedStyles.php
r51568 r51657 713 713 $errors = array(); 714 714 set_error_handler( 715 function ( $errno = 0, $errstr = '' ) use ( &$errors ) {715 static function ( $errno = 0, $errstr = '' ) use ( &$errors ) { 716 716 $errors[] = $errstr; 717 717 return false; -
trunk/tests/phpunit/tests/blocks/wpBlock.php
r51568 r51657 276 276 'core/dynamic', 277 277 array( 278 'render_callback' => function() {278 'render_callback' => static function() { 279 279 return 'b'; 280 280 }, … … 297 297 'core/greeting', 298 298 array( 299 'render_callback' => function( $attributes, $content, $block ) {299 'render_callback' => static function( $attributes, $content, $block ) { 300 300 return sprintf( 'Hello from %s', $block->name ); 301 301 }, … … 367 367 ), 368 368 ), 369 'render_callback' => function( $block_attributes ) {369 'render_callback' => static function( $block_attributes ) { 370 370 return sprintf( 371 371 'Hello %s%s', … … 392 392 'core/outer', 393 393 array( 394 'render_callback' => function( $block_attributes, $content ) {394 'render_callback' => static function( $block_attributes, $content ) { 395 395 return $content; 396 396 }, … … 400 400 'core/inner', 401 401 array( 402 'render_callback' => function() {402 'render_callback' => static function() { 403 403 return 'b'; 404 404 }, -
trunk/tests/phpunit/tests/canonical.php
r51568 r51657 248 248 add_filter( 249 249 'pre_redirect_guess_404_permalink', 250 function() {250 static function() { 251 251 return 'wp'; 252 252 } -
trunk/tests/phpunit/tests/category/walkerCategory.php
r51568 r51657 39 39 add_filter( 40 40 'category_list_link_attributes', 41 function( $atts ) use ( $value ) {41 static function( $atts ) use ( $value ) { 42 42 $atts['data-test'] = $value; 43 43 return $atts; -
trunk/tests/phpunit/tests/comment/commentsTemplate.php
r51462 r51657 994 994 add_filter( 995 995 'comments_template_query_args', 996 function ( $args ) use ( &$offset, $query_args ) {996 static function ( $args ) use ( &$offset, $query_args ) { 997 997 $offset = $args['offset']; 998 998 … … 1004 1004 add_filter( 1005 1005 'comments_template_top_level_query_args', 1006 function ( $args ) use ( $top_level_query_args ) {1006 static function ( $args ) use ( $top_level_query_args ) { 1007 1007 return array_merge( $args, $top_level_query_args ); 1008 1008 } -
trunk/tests/phpunit/tests/cron.php
r51619 r51657 1056 1056 add_filter( 1057 1057 'pre_update_option_cron', 1058 function() {1058 static function() { 1059 1059 return get_option( 'cron' ); 1060 1060 } … … 1076 1076 add_filter( 1077 1077 'pre_update_option_cron', 1078 function() {1078 static function() { 1079 1079 return get_option( 'cron' ); 1080 1080 } … … 1099 1099 add_filter( 1100 1100 'pre_update_option_cron', 1101 function() {1101 static function() { 1102 1102 return get_option( 'cron' ); 1103 1103 } … … 1123 1123 add_filter( 1124 1124 'pre_update_option_cron', 1125 function() {1125 static function() { 1126 1126 return get_option( 'cron' ); 1127 1127 } -
trunk/tests/phpunit/tests/dependencies/wpInlineScriptTag.php
r50409 r51657 81 81 add_filter( 82 82 'wp_inline_script_attributes', 83 function ( $attributes ) {83 static function ( $attributes ) { 84 84 if ( isset( $attributes['id'] ) && 'utils-js-extra' === $attributes['id'] ) { 85 85 $attributes['async'] = true; -
trunk/tests/phpunit/tests/dependencies/wpScriptTag.php
r50409 r51657 65 65 add_filter( 66 66 'wp_script_attributes', 67 function ( $attributes ) {67 static function ( $attributes ) { 68 68 if ( isset( $attributes['id'] ) && 'utils-js-extra' === $attributes['id'] ) { 69 69 $attributes['async'] = true; -
trunk/tests/phpunit/tests/https-detection.php
r51568 r51657 118 118 add_filter( 119 119 'pre_wp_update_https_detection_errors', 120 function() {120 static function() { 121 121 return new WP_Error(); 122 122 } … … 128 128 add_filter( 129 129 'pre_wp_update_https_detection_errors', 130 function() {130 static function() { 131 131 return new WP_Error( 132 132 'ssl_verification_failed', … … 346 346 */ 347 347 private function filter_set_url_scheme( $scheme ) { 348 return function( $url ) use ( $scheme ) {348 return static function( $url ) use ( $scheme ) { 349 349 return set_url_scheme( $url, $scheme ); 350 350 }; -
trunk/tests/phpunit/tests/https-migration.php
r50284 r51657 162 162 $scheme = $enabled ? 'https' : 'http'; 163 163 164 $replace_scheme = function( $url ) use ( $scheme ) {164 $replace_scheme = static function( $url ) use ( $scheme ) { 165 165 return str_replace( array( 'http://', 'https://' ), $scheme . '://', $url ); 166 166 }; … … 173 173 add_filter( 174 174 "option_$option", 175 function() use ( $value ) {175 static function() use ( $value ) { 176 176 return $value; 177 177 } -
trunk/tests/phpunit/tests/image/intermediateSize.php
r51568 r51657 70 70 add_filter( 71 71 'image_editor_output_format', 72 function() {72 static function() { 73 73 return array( 'image/jpeg' => 'image/webp' ); 74 74 } -
trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
r50456 r51657 50 50 array( 51 51 'site_url', 52 function ( $site_url ) {52 static function ( $site_url ) { 53 53 return $site_url . '/wp'; 54 54 }, … … 63 63 array( 64 64 'plugins_url', 65 function () {65 static function () { 66 66 return 'https://plugins.example.com'; 67 67 }, … … 76 76 array( 77 77 'content_url', 78 function () {78 static function () { 79 79 return 'https://content.example.com'; 80 80 }, … … 89 89 array( 90 90 'content_url', 91 function () {91 static function () { 92 92 return '/'; 93 93 }, … … 102 102 array( 103 103 'plugins_url', 104 function () {104 static function () { 105 105 return '/'; 106 106 }, … … 115 115 array( 116 116 'site_url', 117 function () {117 static function () { 118 118 return '/wp'; 119 119 }, -
trunk/tests/phpunit/tests/menu/walker-nav-menu.php
r51568 r51657 95 95 add_filter( 96 96 'nav_menu_link_attributes', 97 function( $atts ) use ( $value ) {97 static function( $atts ) use ( $value ) { 98 98 $atts['data-test'] = $value; 99 99 return $atts; -
trunk/tests/phpunit/tests/post/revisions.php
r51568 r51657 595 595 add_filter( 596 596 'wp_revisions_to_keep', 597 function () use ( $expected ) {597 static function () use ( $expected ) { 598 598 return $expected; 599 599 } … … 620 620 add_filter( 621 621 'wp_revisions_to_keep', 622 function () use ( $generic ) {622 static function () use ( $generic ) { 623 623 return $generic; 624 624 } … … 631 631 add_filter( 632 632 "wp_{$post->post_type}_revisions_to_keep", 633 function () use ( $expected ) {633 static function () use ( $expected ) { 634 634 return $expected; 635 635 } -
trunk/tests/phpunit/tests/post/walkerPage.php
r51568 r51657 34 34 add_filter( 35 35 'page_menu_link_attributes', 36 function( $atts ) use ( $value ) {36 static function( $atts ) use ( $value ) { 37 37 $atts['data-test'] = $value; 38 38 return $atts; -
trunk/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php
r51568 r51657 938 938 add_action( 939 939 'application_password_did_authenticate', 940 function() {940 static function() { 941 941 $GLOBALS['wp_rest_application_password_uuid'] = 'invalid_uuid'; 942 942 } -
trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
r51568 r51657 436 436 wp_set_current_user( self::$user_id ); 437 437 438 $pre_render_filter = function( $output, $block ) {438 $pre_render_filter = static function( $output, $block ) { 439 439 if ( $block['blockName'] === self::$block_name ) { 440 440 return '<p>Alternate content.</p>'; -
trunk/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php
r51461 r51657 273 273 add_filter( 274 274 'rest_prepare_block_pattern', 275 function( $response ) {275 static function( $response ) { 276 276 return 'initial value'; 277 277 } … … 287 287 add_filter( 288 288 'rest_prepare_block_pattern', 289 function( $response ) {289 static function( $response ) { 290 290 return 'modified the cache'; 291 291 }, -
trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php
r51571 r51657 2709 2709 'type' => 'boolean', 2710 2710 'show_in_rest' => true, 2711 'sanitize_callback' => function( $value ) {2711 'sanitize_callback' => static function( $value ) { 2712 2712 return $value ? '1' : '0'; 2713 2713 }, -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r51568 r51657 2138 2138 public function test_prepare_item_filters_content_when_needed() { 2139 2139 $filter_count = 0; 2140 $filter_content = function() use ( &$filter_count ) {2140 $filter_content = static function() use ( &$filter_count ) { 2141 2141 $filter_count++; 2142 2142 return '<p>Filtered content.</p>'; … … 2174 2174 public function test_prepare_item_skips_content_filter_if_not_needed() { 2175 2175 $filter_count = 0; 2176 $filter_content = function() use ( &$filter_count ) {2176 $filter_content = static function() use ( &$filter_count ) { 2177 2177 $filter_count++; 2178 2178 return '<p>Filtered content.</p>'; -
trunk/tests/phpunit/tests/rest-api/rest-request.php
r51577 r51657 476 476 'args' => array( 477 477 'failparam' => array( 478 'sanitize_callback' => function () {478 'sanitize_callback' => static function () { 479 479 $error = new WP_Error( 'invalid', 'Invalid.' ); 480 480 $error->add( 'invalid', 'Super Invalid.' ); … … 511 511 'args' => array( 512 512 'failparam' => array( 513 'sanitize_callback' => function () {513 'sanitize_callback' => static function () { 514 514 return new WP_Error( 'invalid', 'Invalid.', 'mydata' ); 515 515 }, … … 739 739 'args' => array( 740 740 'failparam' => array( 741 'validate_callback' => function () {741 'validate_callback' => static function () { 742 742 $error = new WP_Error( 'invalid', 'Invalid.' ); 743 743 $error->add( 'invalid', 'Super Invalid.' ); … … 774 774 'args' => array( 775 775 'failparam' => array( 776 'validate_callback' => function () {776 'validate_callback' => static function () { 777 777 return new WP_Error( 'invalid', 'Invalid.', 'mydata' ); 778 778 }, -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r51577 r51657 1393 1393 array( 1394 1394 'methods' => array( 'GET' ), 1395 'callback' => function () {1395 'callback' => static function () { 1396 1396 return new WP_REST_Response(); 1397 1397 }, … … 1415 1415 array( 1416 1416 'methods' => array( 'GET' ), 1417 'callback' => function () {1417 'callback' => static function () { 1418 1418 return new WP_REST_Response( 'data', 204 ); 1419 1419 }, … … 1506 1506 array( 1507 1507 'methods' => array( 'GET' ), 1508 'callback' => function() {1508 'callback' => static function() { 1509 1509 return new WP_REST_Response( 'data', 204 ); 1510 1510 }, … … 1517 1517 array( 1518 1518 'methods' => array( 'GET' ), 1519 'callback' => function() {1519 'callback' => static function() { 1520 1520 return new WP_REST_Response( 'data', 204 ); 1521 1521 }, … … 1929 1929 array( 1930 1930 'methods' => array( 'POST', 'DELETE' ), 1931 'callback' => function ( WP_REST_Request $request ) {1931 'callback' => static function ( WP_REST_Request $request ) { 1932 1932 return new WP_REST_Response( 'test' ); 1933 1933 }, -
trunk/tests/phpunit/tests/rest-api/rest-widget-types-controller.php
r51235 r51657 150 150 $text_widgets = array_filter( 151 151 $data, 152 function( $widget ) {152 static function( $widget ) { 153 153 return 'text' === $widget['id']; 154 154 } … … 178 178 $widget_id, 179 179 'WP legacy widget', 180 function() {}180 static function() {} 181 181 ); 182 182 wp_set_current_user( self::$admin_id ); … … 209 209 $widget_id, 210 210 '‘Legacy ‑ Archive ‑ Widget’', 211 function() {},211 static function() {}, 212 212 array( 213 213 'description' => '“A great & interesting archive of your site’s posts!”', -
trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php
r51568 r51657 109 109 'testwidget', 110 110 'WP test widget', 111 function () {111 static function () { 112 112 $settings = get_option( 'widget_testwidget' ); 113 113 … … 128 128 'testwidget', 129 129 'WP test widget', 130 function () {130 static function () { 131 131 $settings = wp_parse_args( 132 132 get_option( 'widget_testwidget' ), -
trunk/tests/phpunit/tests/robots.php
r51568 r51657 44 44 add_filter( 45 45 'wp_robots', 46 function( array $robots ) {46 static function( array $robots ) { 47 47 // Directives that should have values must use strings. 48 48 $robots['directive-with-value'] = 'yes';
Note: See TracChangeset
for help on using the changeset viewer.