Core Function
View Source on Trac ↗ rest_filter_response_by_context()
rest_filter_response_by_context( mixed $response_data, mixed $schema, mixed $context ) Filters the response to remove any fields not available in the given context.
Parameters 3 required
| Name / Type | Description |
|---|---|
| (array | | object) $response_data The response data to modify. Required |
| $schema array | The schema for the endpoint used to filter the response. Required |
| $context string | The requested context. Required |
Return Value
((array)
| object) The filtered response data.
Function Information
Since Version
5.5.0
Source File
wp-includes/rest-api.php
Advertisement