is_multisite

Definition:
function is_multisite() {}

Whether Multisite support is enabled

Return values

returns:True if multisite is enabled, false otherwise.

Source code

function is_multisite() {

	if ( defined( 'MULTISITE' ) )

		return MULTISITE;



	if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) )

		return true;



	return false;

}

2139

is_month

Definition:
function is_month() {}

Is the query for a month archive?

Source code

	function is_month() {

		return (bool) $this->is_month;

	}

2137

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

is_main_blog

Definition:
function is_main_blog() {}

Source code

function is_main_blog() {

	_deprecated_function( __FUNCTION__, '3.0', 'is_main_site()' );

	return is_main_site();

}

2133

is_local_attachment

Definition:
function is_local_attachment($url) {}

Check if the attachment URI is local one and is really an attachment.

Parameters

  • string $url: URL to check

Return values

returns:True on success, false on failure.

Source code

function is_local_attachment($url) {

	if (strpos($url, home_url()) === false)

		return false;

	if (strpos($url, home_url('/?attachment_id=')) !== false)

		return true;

	if ( $id = url_to_postid($url) ) {

		$post = & get_post($id);

		if ( 'attachment' == $post->post_type )

			return true;

	}

	return false;

}

2131