W3cubDocs

/WordPress

apply_filters( ‘rest_envelope_response’, array $envelope, WP_REST_Response $response )

Filters the enveloped form of a REST API response.

Parameters

$envelopearray
Envelope data.
  • body array
    Response data.
  • status int
    The 3-digit HTTP status code.
  • headers array
    Map of header name to header value.
$responseWP_REST_Response
Original response data.

Source

$envelope = apply_filters( 'rest_envelope_response', $envelope, $response );

Changelog

Version Description
4.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/rest_envelope_response