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.


Top ↑

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.


Top ↑

Source

File: wp-includes/class-wp-network-query.php

	public function query( $query ) {
		$this->query_vars = wp_parse_args( $query );
		return $this->get_networks();
	}


Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.