found_sites_query WordPress Filter Hook

The found_sites_query hook is used to alter the SQL query that WordPress uses to search for sites in a Multisite installation. This hook is useful for optimizing the performance of WordPress Multisite installations, as it allows you to alter the SQL query to only search for sites that meet certain criteria. For example, you could use this hook to only search for sites that are in the same network as the current site, or that have the same domain name.

apply_filters( 'found_sites_query', string $found_sites_query, WP_Site_Query $site_query ) #

Filters the query used to retrieve found site count.


Parameters

$found_sites_query

(string)SQL query. Default 'SELECT FOUND_ROWS()'.

$site_query

(WP_Site_Query)The WP_Site_Query instance.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.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.