WP_REST_Controller::filter_response_by_context( array $data, string $context )
Filters a response based on the context defined in the schema.
Parameters Parameters
- $data
-
(array) (Required) Response data to filter.
- $context
-
(string) (Required) Context defined in the schema.
Return Return
(array) Filtered response.
Source Source
File: wp-includes/rest-api/endpoints/class-wp-rest-controller.php
public function filter_response_by_context( $data, $context ) { $schema = $this->get_item_schema(); return rest_filter_response_by_context( $data, $schema, $context ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |