filtrod 4.4.0
rest_envelope_response
Opis — z kodu źródłowego
Filters the enveloped form of a REST API response.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$envelope | array | { 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_Response | Original 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
}
// 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