WordPress filter hook · part of WordPress core

split_the_query

A WordPress core filter that 9 plugins also fire themselves, running on 24K+ sites between them.

“Filters whether to split the query.”

How to use split_the_query

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'split_the_query', function( $split_the_query, $object ) {
	// Change $split_the_query here.
	return $split_the_query;
}, 10, 2 );

Argument names come from GamiPress's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

9 plugins that fire split_the_query

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. GamiPress icon GamiPress10,000+ installs apply_filters( 'split_the_query', $split_the_query, $this ) libraries/ct/includes/class-ct-query.php:670
  2. ALD icon ALD8,000+ installs apply_filters( 'split_the_query', $split_the_query, $this ) includes/ali-product-query.php:1167
  3. AutomatorWP icon AutomatorWP6,000+ installs apply_filters( 'split_the_query', $split_the_query, $this ) libraries/ct/includes/class-ct-query.php:670
  4. ChinaDS icon ChinaDS100+ installs apply_filters( 'split_the_query', $split_the_query, $this ) inc/taobao-post-query.php:1207
  5. ShortLinks Pro icon ShortLinks Pro100+ installs apply_filters( 'split_the_query', $split_the_query, $this ) libraries/ct/includes/class-ct-query.php:670
  6. HANDMADE icon HANDMADE40+ installs apply_filters( 'split_the_query', $split_the_query, $this ) includes/class/handmade-post-query.php:1027
  7. BBForms icon BBForms20+ installs apply_filters( 'split_the_query', $split_the_query, $this ) libraries/ct/includes/class-ct-query.php:670
  8. WhatAvatar icon WhatAvatar10+ installs apply_filters( 'split_the_query', $split_the_query, $this ) libraries/ct/includes/class-ct-query.php:670
  9. Gospel Resource Hub icon Gospel Resource HubFewer than 10 installs apply_filters( 'split_the_query', $split_the_query, $this ) includes/class-grh-query.php:1163

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.