get_networks() WordPress Function

The get_networks() function is used to retrieve a list of available networks from a WordPress installation. This function can be used to display a list of networks on a WordPress site, or to retrieve a list of networks for use in a plugin or theme.

get_networks( string|array $args = array() ) #

Retrieves a list of networks.


Parameters

$args

(string|array)(Optional) Array or string of arguments. See WP_Network_Query::parse_query() for information on accepted arguments.

Default value: array()


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/ms-network.php

function get_networks( $args = array() ) {
	$query = new WP_Network_Query();

	return $query->query( $args );
}


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.