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.
Source
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |