278 | | /** |
279 | | * Filters the query used to retrieve found site count. |
280 | | * |
281 | | * @since 4.6.0 |
282 | | * |
283 | | * @param string $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'. |
284 | | * @param WP_Site_Query $site_query The `WP_Site_Query` instance. |
285 | | */ |
286 | | $found_sites_query = apply_filters( 'found_sites_query', 'SELECT FOUND_ROWS()', $this ); |
| 278 | $found_sites_cache_key = "found_sites_query:$key:$last_changed"; |
| 279 | $found_sites = wp_cache_get( $found_sites_cache_key, 'sites' ); |
| 280 | if ( false === $found_sites ) { |
| 281 | /** |
| 282 | * Filters the query used to retrieve found site count. |
| 283 | * |
| 284 | * @since 4.6.0 |
| 285 | * |
| 286 | * @param string $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'. |
| 287 | * @param WP_Site_Query $site_query The `WP_Site_Query` instance. |
| 288 | */ |
| 289 | $found_sites_query = apply_filters( 'found_sites_query', 'SELECT FOUND_ROWS()', $this ); |
| 290 | $found_sites = (int) $wpdb->get_var( $found_sites_query ); |
| 291 | wp_cache_add( $found_sites_cache_key, $found_sites, 'sites' ); |
| 292 | } |