WP_REST_Controller::filter_response_by_context( array $response_data, string $context ): array

Filters a response based on the context defined in the schema.


Parameters

$response_data array Required
Response data to filter.
$context string Required
Context defined in the schema.

Top ↑

Return

array Filtered response.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-controller.php. View all references

public function filter_response_by_context( $response_data, $context ) {

	$schema = $this->get_item_schema();

	return rest_filter_response_by_context( $response_data, $schema, $context );
}


Top ↑

Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.