filtrod 4.4.0
rest_namespace_index
Opis — z kodu źródłowego
Filters the REST API namespace index data.
This typically is just the route data for the namespace, but you can add any data you'd like here.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$response | \WP_REST_Response | Response data. |
$request | \WP_REST_Request | Request data. The namespace is passed as the 'namespace' parameter. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_namespace_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_namespace_index', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii