filtrod 4.4.0
rest_dispatch_request
Opis — z kodu źródłowego
Filters the REST API dispatch request result.
Allow plugins to override dispatching the request.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$dispatch_result | mixed | Dispatch result, will be used if not empty. |
$request | \WP_REST_Request | Request used to generate the response. |
$route | string | Route matched for the request. |
$handler | array | Route handler used for the request. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_dispatch_request', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_dispatch_request', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii