} $context = !
empty( $request['context'
] ) ?
$request['context'
] : 'view';
$data =
$this->
add_additional_fields_to_object( $data,
$request );
$data =
$this->
filter_response_by_context( $data,
$context );
// Wrap the data in a response object.
$response =
rest_ensure_response( $data );
if ( rest_is_field_included( '_links',
$fields ) ||
rest_is_field_included( '_embedded',
$fields ) ) { $response->
add_links( $this->
prepare_links( $taxonomy ) );
} /**
* Filters a taxonomy returned from the REST API.
*
* Allows modification of the taxonomy data right before it is returned.
*
* @since 4.7.0
*
* @param WP_REST_Response $response The response object.
* @param WP_Taxonomy $item The original taxonomy object.
* @param WP_REST_Request $request Request used to generate the response.
*/