Skip to content

Commit

Permalink
Excluding search, include and exclude from the collection query params
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jan 3, 2024
1 parent b047cd0 commit 40e93b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
23 changes: 0 additions & 23 deletions tests/qunit/fixtures/wp-api-generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 40e93b9

Please sign in to comment.