WP_Network_Query::query
Sets up the WordPress query for retrieving networks.
Method of the class: WP_Network_Query{}
No Hooks.
Returns
Array|Int. List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', or the number of networks when 'count' is passed as a query var.
Usage
$WP_Network_Query = new WP_Network_Query(); $WP_Network_Query->query( $query );
- $query(string|array) (required)
- Array or URL query string of parameters.
Changelog
| Since 4.6.0 | Introduced. |
WP_Network_Query::query() WP Network Query::query code WP 6.9.1
public function query( $query ) {
$this->query_vars = wp_parse_args( $query );
return $this->get_networks();
}