WP_Network_Query::set_found_networks() private WP 4.6.0
Populates found_networks and max_num_pages properties for the current query if the limit clause was used.
{} It's a method of the class: WP_Network_Query{}
Hooks from the method
Return
Null. Nothing.
Usage
// private - for code of main (parent) class only $result = $this->set_found_networks();
Notes
- Global. wpdb. $wpdb WordPress database abstraction object.
Changelog
Since 4.6.0 | Introduced. |
Code of WP_Network_Query::set_found_networks() WP Network Query::set found networks WP 5.6
private function set_found_networks() {
global $wpdb;
if ( $this->query_vars['number'] && ! $this->query_vars['no_found_rows'] ) {
/**
* Filters the query used to retrieve found network count.
*
* @since 4.6.0
*
* @param string $found_networks_query SQL query. Default 'SELECT FOUND_ROWS()'.
* @param WP_Network_Query $network_query The `WP_Network_Query` instance.
*/
$found_networks_query = apply_filters( 'found_networks_query', 'SELECT FOUND_ROWS()', $this );
$this->found_networks = (int) $wpdb->get_var( $found_networks_query );
}
}