WP HOOKS
filtrod 4.4.0

rest_envelope_response

Args 2Plik wp-includes/rest-api/class-wp-rest-server.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the enveloped form of a REST API response.

Parametry

ParametrTypOpis
$envelopearray{ Envelope data. @type array $body Response data. @type int $status The 3-digit HTTP status code. @type array $headers Map of header name to header value. }
$response\WP_REST_ResponseOriginal response data.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_envelope_response', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii