mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 10:02:43 +01:00
add is_main_site() function, See #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@12714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f3096d0ecb
commit
4b4316bdf8
@ -3461,6 +3461,28 @@ function set_site_transient($transient, $value, $expiration = 0) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* is main site
|
||||
*
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @package WordPress
|
||||
*
|
||||
* @param int $blog_id optional blog id to test (default current blog)
|
||||
* @return bool True if not multisite or $blog_id is main site
|
||||
*/
|
||||
function is_main_site( $blog_id = '' ) {
|
||||
global $current_site, $current_blog;
|
||||
|
||||
if ( !is_multisite() )
|
||||
return true;
|
||||
|
||||
if ( !$blog_id )
|
||||
$blog_id = $current_blog->blog_id;
|
||||
|
||||
return $blog_id == $current_site->blog_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* gmt_offset modification for smart timezone handling
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user