filtrod 4.4.0
rest_index
Opis — z kodu źródłowego
Filters the REST API root index data.
This contains the data describing the API. This includes information about supported authentication schemes, supported namespaces, routes available on the API, and a small amount of data about the site.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$response | \WP_REST_Response | Response data. |
$request | \WP_REST_Request | Request data. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_index', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_index', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii