filtrod 6.2.0
post_search_columns
Opis — z kodu źródłowego
Filters the columns to search in a WP_Query search.
The supported columns are post_title, post_excerpt and post_content. They are all included by default.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$search_columns | string[] | Array of column names to be searched. |
$search | string | Text being searched. |
$query | \WP_Query | The current WP_Query instance. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'post_search_columns', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'post_search_columns', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii