filtrreferencjaod 5.3.0
terms_pre_query
Opis — z kodu źródłowego
Filters the terms array before the query takes place.
Return a non-null value to bypass WordPress' default term queries.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$terms | array | null | Return an array of term data to short-circuit WP's term query, or null to allow WP queries to run normally. |
$query | \WP_Term_Query | The WP_Term_Query instance, passed by reference. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'terms_pre_query', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_filter( 'terms_pre_query', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii