From 7e40ac4c9d2d964332ca4f7a948cb683c527e207 Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 23 Nov 2023 20:15:41 +1100 Subject: [PATCH] Revert introducing title in schema --- .../class-wp-rest-global-styles-revisions-controller.php | 2 +- .../tests/rest-api/rest-global-styles-revisions-controller.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php index 17f20b7989f46..f27166b758ec1 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php @@ -305,7 +305,7 @@ public function get_item_schema() { unset( $schema['properties']['slug'] ); unset( $schema['properties']['meta'] ); unset( $schema['properties']['content'] ); - unset( $schema['properties']['excerpt'] ); + unset( $schema['properties']['title'] ); $this->schema = $schema; diff --git a/tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php b/tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php index d8f32feec8f6f..27336cfa9ea4f 100644 --- a/tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php +++ b/tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php @@ -368,10 +368,9 @@ public function test_get_item_schema() { $data = $response->get_data(); $properties = $data['schema']['properties']; - $this->assertCount( 10, $properties, 'Schema properties array has exactly 10 elements.' ); + $this->assertCount( 9, $properties, 'Schema properties array has exactly 9 elements.' ); $this->assertArrayHasKey( 'id', $properties, 'Schema properties array has "id" key.' ); $this->assertArrayHasKey( 'styles', $properties, 'Schema properties array has "styles" key.' ); - $this->assertArrayHasKey( 'title', $properties, 'Schema properties array has "title" key.' ); $this->assertArrayHasKey( 'settings', $properties, 'Schema properties array has "settings" key.' ); $this->assertArrayHasKey( 'parent', $properties, 'Schema properties array has "parent" key.' ); $this->assertArrayHasKey( 'author', $properties, 'Schema properties array has "author" key.' );