WP HOOKS
filtrod 3.4.0

split_the_query

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

Opis — z kodu źródłowego

Filters whether to split the query.

Splitting the query will cause it to fetch just the IDs of the found posts (and then individually fetch each post by ID), rather than fetching every complete row at once. One massive result vs. many small results.

Parametry

ParametrTypOpis
$split_the_queryboolWhether or not to split the query.
$query\WP_QueryThe WP_Query instance.
$old_requeststringThe complete SQL query before filtering.
$clausesstring[]{ Associative array of the clauses for the query. @type string $where The WHERE clause of the query. @type string $groupby The GROUP BY clause of the query. @type string $join The JOIN clause of the query. @type string $orderby The ORDER BY clause of the query. @type string $distinct The DISTINCT clause of the query. @type string $fields The SELECT clause of the query. @type string $limits The LIMIT clause of the query. }

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'split_the_query', 'twoja_funkcja', 10, 4 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
	// Twój kod
}

Popularne w tej kategorii