filtrod 3.4.0
split_the_query
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
| Parametr | Typ | Opis |
|---|---|---|
$split_the_query | bool | Whether or not to split the query. |
$query | \WP_Query | The WP_Query instance. |
$old_request | string | The complete SQL query before filtering. |
$clauses | string[] | { 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
}
// 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