Multisite: move get_current_site() to load.php so that it can be used in more places, instead of importing global $current_site.

See #37699.

Built from https://develop.svn.wordpress.org/trunk@38388


git-svn-id: http://core.svn.wordpress.org/trunk@38329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2016-08-26 21:35:30 +00:00
parent 35bdc07eac
commit 08233c6aff
7 changed files with 48 additions and 54 deletions

View File

@@ -1059,3 +1059,22 @@ function wp_doing_ajax() {
function is_wp_error( $thing ) {
return ( $thing instanceof WP_Error );
}
/**
* Get the current network.
*
* Returns an object containing the 'id', 'domain', 'path', and 'site_name'
* properties of the network being viewed.
*
* @see wpmu_current_site()
*
* @since MU
*
* @global WP_Network $current_site
*
* @return WP_Network
*/
function get_current_site() {
global $current_site;
return $current_site;
}