filtrod 4.8.1
rest_pre_echo_response
Opis — z kodu źródłowego
Filters the REST API response.
Allows modification of the response data after inserting embedded data (if any) and before echoing the response data.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$result | array | Response data to send to the client. |
$server | \WP_REST_Server | Server instance. |
$request | \WP_REST_Request | Request used to generate the response. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_pre_echo_response', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_pre_echo_response', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii