split_the_query WordPress Filter Hook

The split_the_query hook is used to modify the SQL query that is used to fetch posts from the database. This hook is called after the query has been split into SQL parts, but before the parts are combined into a final SQL query.

apply_filters( 'split_the_query', bool $split_the_query, WP_Query $query ) #

Filters whether to split the query.


Description

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.


Top ↑

Parameters

$split_the_query

(bool)Whether or not to split the query.

$query

(WP_Query)The WP_Query instance.


Top ↑

Source

File: wp-includes/class-wp-query.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More