$served =
apply_filters( 'rest_pre_serve_request', false,
$result,
$request,
$this );
if ( !
$served ) { if ( 'HEAD' ===
$request->
get_method() ) { return null;
} // Embed links inside the request.
$embed =
isset( $_GET['_embed'
] ) ?
rest_parse_embed_param( $_GET['_embed'
] ) : false;
$result =
$this->
response_to_data( $result,
$embed );
/**
* Filters the REST API response.
*
* Allows modification of the response data after inserting
* embedded data (if any) and before echoing the response data.
*
* @since 4.8.1
*
* @param array $result Response data to send to the client.
* @param WP_REST_Server $server Server instance.
* @param WP_REST_Request $request Request used to generate the response.
*/