Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/wp-includes/rest-api/class-wp-rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
12 changes: 2 additions & 10 deletions tests/phpunit/tests/rest-api/rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.' );
}

Expand Down
Loading