filtrdynamicznyod 4.7.0
rest_query_var-{$key}
Args 1Plik wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
Opis — z kodu źródłowego
Filters the query_vars used in get_items() for the constructed query.
The dynamic portion of the hook name, $key, refers to the query_var key.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$value | string | The query_var value. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'rest_query_var-{$key}', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_filter( 'rest_query_var-{$key}', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii