From 40e93b9964530364338e07c21138bb27e1804a00 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 3 Jan 2024 12:21:26 +1100 Subject: [PATCH] Excluding search, include and exclude from the collection query params --- ...est-global-styles-revisions-controller.php | 15 ++++++++++++ tests/qunit/fixtures/wp-api-generated.js | 23 ------------------- 2 files changed, 15 insertions(+), 23 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 c3c58b8bf1dee..9e931f9336460 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 @@ -311,4 +311,19 @@ public function get_item_schema() { return $this->add_additional_fields_schema( $this->schema ); } + + /** + * Retrieves the query params for collections. + * + * @since 6.5.0 + * + * @return array Collection parameters. + */ + public function get_collection_params() { + $query_params = parent::get_collection_params(); + unset( $query_params['exclude'] ); + unset( $query_params['include'] ); + unset( $query_params['search'] ); + return $query_params; + } } diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 38ff5b8a0e306..a60a1897a6cf5 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -10035,29 +10035,6 @@ mockedApiResponse.Schema = { "maximum": 100, "required": false }, - "search": { - "description": "Limit results to those matching a string.", - "type": "string", - "required": false - }, - "exclude": { - "description": "Ensure result set excludes specific IDs.", - "type": "array", - "items": { - "type": "integer" - }, - "default": [], - "required": false - }, - "include": { - "description": "Limit result set to specific IDs.", - "type": "array", - "items": { - "type": "integer" - }, - "default": [], - "required": false - }, "offset": { "description": "Offset the result set by a specific number of items.", "type": "integer",