get_current_site

Get the current network.

Description

(WP_Network) get_current_site(); 

Returns an object containing the id,, domain, path, and site_name properties of the network being viewed.

Returns (WP_Network)


Usage

  1. if ( !function_exists( 'get_current_site' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_current_site(); 
  7.  

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function get_current_site() { 
  2. global $current_site; 
  3. return $current_site;