WordPress at a glance
filter is not described

sites_pre_query filter-hook . WP 5.2.0

Filter the sites array before the query takes place.

Return a non-null value to bypass WordPress's default site queries.


add_filter( 'sites_pre_query', 'filter_function_name_7381', 10, 2 );
function filter_function_name_7381( $site_ids, $this ){
	// filter...

	return $site_ids;
Return an array of site data to short-circuit WP's site query, or null to allow WP to run its normal queries.
The WP_Site_Query instance, passed by reference.


Since 5.2.0 Introduced.

Where the hook is called

wp-includes/class-wp-site-query.php 305
$site_ids = apply_filters_ref_array( 'sites_pre_query', array( $site_ids, &$this ) );

Where the hook is used (in WP core)

Usage not found!