WordPress at Your Fingertips
filter is not described

rest_envelope_response filter-hook . WP 4.4.0

Filters the enveloped form of a REST API response.

Usage

add_filter( 'rest_envelope_response', 'filter_function_name_2201', 10, 2 );
function filter_function_name_2201( $envelope, $response ){
	// filter...

	return $envelope;
}
$envelope(array)

Envelope data.

  • body(array)
    Response data.

  • status(int)
    The 3-digit HTTP status code.

  • headers(array)
    Map of header name to header value.
$response(WP_REST_Response)
Original response data.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

WP_REST_Server::envelope_response()
rest_envelope_response
wp-includes/rest-api/class-wp-rest-server.php 758
$envelope = apply_filters( 'rest_envelope_response', $envelope, $response );

Where in WP core the hook is used WordPress

Usage not found.