filtrdynamicznyod 4.7.0
rest_{$this->taxonomy}_collection_params
Args 2Plik wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
Opis — z kodu źródłowego
Filters collection parameters for the terms controller.
The dynamic part of the filter $this->taxonomy refers to the taxonomy slug for the controller.
This filter registers the collection parameter, but does not map the collection parameter to an internal WP_Term_Query parameter. Use the rest_{$this->taxonomy}_query filter to set WP_Term_Query parameters.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$query_params | array | JSON Schema-formatted collection parameters. |
$taxonomy | \WP_Taxonomy | Taxonomy object. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_{$this->taxonomy}_collection_params', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_{$this->taxonomy}_collection_params', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii