WP_Network_Query::query() WordPress Method
The query() method is part of the WP_Network_Query class. It is used to retrieve a list of networks. The networks are stored in an array and can be accessed using the various methods of the WP_Network_Query class.
WP_Network_Query::query( string|array $query ) #
Sets up the WordPress query for retrieving networks.
Parameters
- $query
(string|array)(Required)Array or URL query string of parameters.
Return
(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.
Source
File: wp-includes/class-wp-network-query.php
public function query( $query ) { $this->query_vars = wp_parse_args( $query ); return $this->get_networks(); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |