diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index ed583cc900655..612b00e780915 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/wp-includes/rest-api/class-wp-rest-server.php @@ -1861,12 +1861,6 @@ public function get_data_for_route( $route, $callbacks, $context = 'view' ) { $endpoint_data['allow_batch'] = $callback_batch; } - $data_processing = self::resolve_data_processing( $callback, $route_options ); - - if ( in_array( false, $data_processing, true ) ) { - $endpoint_data['data_processing'] = $data_processing; - } - if ( isset( $callback['args'] ) ) { $endpoint_data['args'] = array(); diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php index 3ff82c7231fd1..f0c2e098ebddb 100644 --- a/tests/phpunit/tests/rest-api/rest-server.php +++ b/tests/phpunit/tests/rest-api/rest-server.php @@ -3576,7 +3576,7 @@ public function test_data_processing_applies_to_batch_requests(): void { /** * @ticket 66372 */ - public function test_data_processing_is_listed_in_the_index(): void { + public function test_data_processing_is_not_listed_in_the_index(): void { rest_get_server()->register_route( 'test-ns', '/test-ns/data-processing', @@ -3600,15 +3600,7 @@ public function test_data_processing_is_listed_in_the_index(): void { $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); - $this->assertSame( - array( - 'fields' => false, - 'embed' => true, - 'links' => true, - ), - $data['endpoints'][0]['data_processing'], - 'An endpoint with a feature turned off should list the settings.' - ); + $this->assertArrayNotHasKey( 'data_processing', $data['endpoints'][0], 'An endpoint with a feature turned off should not list the settings.' ); $this->assertArrayNotHasKey( 'data_processing', $data['endpoints'][1], 'An endpoint with every feature on should not list the settings.' ); }