WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Рекомендуемые продукты со скидкой от Template Monster
функция не описана

WP_REST_Server::envelope_response() WP 4.4.0

Wraps the response in an envelope.

The enveloping technique is used to work around browser/client compatibility issues. Essentially, it converts the full HTTP response to data instead.

Это метод класса: WP_REST_Server

Хуки из метода
Возвращает

WP_REST_Response. New response with wrapped data

Использование

$WP_REST_Server = new WP_REST_Server();
$var = $WP_REST_Server->envelope_response( $response, $embed );
$response(WP_REST_Response) (обязательный)
Response object.
$embed(true/false) (обязательный)
Whether links should be embedded.

Список изменений

С версии 4.4.0 Введена.

Код WP REST Server::envelope response: wp-includes/rest-api/class-wp-rest-server.php WP 5.2.4

<?php
public function envelope_response( $response, $embed ) {
	$envelope = array(
		'body'    => $this->response_to_data( $response, $embed ),
		'status'  => $response->get_status(),
		'headers' => $response->get_headers(),
	);

	/**
	 * Filters the enveloped form of a response.
	 *
	 * @since 4.4.0
	 *
	 * @param array            $envelope Envelope data.
	 * @param WP_REST_Response $response Original response data.
	 */
	$envelope = apply_filters( 'rest_envelope_response', $envelope, $response );

	// Ensure it's still a response and return.
	return rest_ensure_response( $envelope );
}