mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion. See #37699. git-svn-id: https://develop.svn.wordpress.org/trunk@38636 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4309,19 +4309,23 @@ function wp_suspend_cache_invalidation( $suspend = true ) {
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @global object $current_site
|
||||
*
|
||||
* @param int $site_id Optional. Site ID to test. Defaults to current site.
|
||||
* @return bool True if $site_id is the main site of the network, or if not
|
||||
* running Multisite.
|
||||
*/
|
||||
function is_main_site( $site_id = null ) {
|
||||
if ( ! is_multisite() ) {
|
||||
return true;
|
||||
}
|
||||
// This is the current network's information; 'site' is old terminology.
|
||||
global $current_site;
|
||||
|
||||
if ( ! $site_id ) {
|
||||
if ( ! is_multisite() )
|
||||
return true;
|
||||
|
||||
if ( ! $site_id )
|
||||
$site_id = get_current_blog_id();
|
||||
}
|
||||
return (int) $site_id === (int) get_current_site()->blog_id;
|
||||
|
||||
return (int) $site_id === (int) $current_site->blog_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user