get_current_site() WordPress Function

The get_current_site() function is used to get the current network object. This function is useful when you need to get information about the current network, such as its name or ID.

get_current_site() #

Gets the current network.


Description

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

Top ↑

See also


Top ↑

Return

(WP_Network)


Top ↑

Source

File: wp-includes/ms-functions.php

function get_current_site() {
	global $current_site;
	return $current_site;
}

Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

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.

Show More
Show More