WP HOOKS
filtrod 6.2.0

post_search_columns

Args 3Plik wp-includes/class-wp-query.phpDokumentacja WP ↗

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

ParametrTypOpis
$search_columnsstring[]Array of column names to be searched.
$searchstringText being searched.
$query\WP_QueryThe 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
}

Popularne w tej kategorii