Advertisements

is_main_site

Definition:
function is_main_site( $blog_id = '' ) {}

Is main site?

Parameters

  • int $blog_id: optional blog id to test (default current blog)

Return values

returns:True if not multisite or $blog_id is main site

Source code

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;

}

2135

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: