get_networks

Retrieves a list of networks.

Description

(int|array) get_networks( (array) $args = array() ); 

Returns (int|array)

List of networks or number of found networks if `$count` argument is true.

Parameters (1)

0. $args — Optional. (array) => array()
Array or string of arguments. See WP_Network_Query::parse_query() for information on accepted arguments. Default empty array.

Usage

  1. if ( !function_exists( 'get_networks' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-blogs.php'; 
  3.  
  4. // Optional. Array or string of arguments. See WP_Network_Query::parse_query() 
  5. // for information on accepted arguments. Default empty array. 
  6. $args = array(); 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = get_networks($args); 
  10.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-blogs.php  
  1. function get_networks( $args = array() ) { 
  2. $query = new WP_Network_Query(); 
  3.  
  4. return $query->query( $args );