filtrod 4.4.0
rest_route_data
Opis — z kodu źródłowego
Filters the publicly-visible data for REST API routes.
This data is exposed on indexes and can be used by clients or developers to investigate the site and find out how to use it. It acts as a form of self-documentation.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$available | array[] | Route data to expose in indexes, keyed by route. |
$routes | array | Internal route data as an associative array. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_route_data', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_route_data', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii