split_the_query хук-фильтрWP 3.4.0

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.


add_filter( 'split_the_query', 'wp_kama_split_the_query_filter', 10, 2 );

 * Function for `split_the_query` filter-hook.
 * @param bool     $split_the_query Whether or not to split the query.
 * @param WP_Query $query           The WP_Query instance.
 * @return bool
function wp_kama_split_the_query_filter( $split_the_query, $query ){

	// filter...
	return $split_the_query;
Whether or not to split the query.
The WP_Query instance.

Список изменений

С версии 3.4.0 Введена.

Где вызывается хук

wp-includes/class-wp-query.php 3305
$split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );

Где используется хук в WordPress

Использование не найдено.