Filter hook 'found_sites_query'

in WP Core File wp-includes/class-wp-site-query.php at line 745

View Source

found_sites_query

Filter Hook
Description
Filters the query used to retrieve found site count.

Hook Information

File Location wp-includes/class-wp-site-query.php View on GitHub
Hook Type Filter
Line Number 745

Hook Parameters

Type Name Description
string $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'.
WP_Site_Query $site_query The `WP_Site_Query` instance.

Usage Examples

Basic Usage
<?php
// Hook into found_sites_query
add_filter('found_sites_query', 'my_custom_filter', 10, 2);

function my_custom_filter($found_sites_query, $site_query) {
    // Your custom filtering logic here
    return $found_sites_query;
}

Source Code Context

wp-includes/class-wp-site-query.php:745 - How this hook is used in WordPress core
<?php
 740  			 * @since 4.6.0
 741  			 *
 742  			 * @param string        $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'.
 743  			 * @param WP_Site_Query $site_query        The `WP_Site_Query` instance.
 744  			 */
 745  			$found_sites_query = apply_filters( 'found_sites_query', 'SELECT FOUND_ROWS()', $this );
 746  
 747  			$this->found_sites = (int) $wpdb->get_var( $found_sites_query );
 748  		}
 749  	}
 750  

PHP Documentation

<?php
/**
			 * Filters the query used to retrieve found site count.
			 *
			 * @since 4.6.0
			 *
			 * @param string        $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'.
			 * @param WP_Site_Query $site_query        The `WP_Site_Query` instance.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-site-query.php
Related Hooks

Related hooks will be displayed here in future updates.