is_subdomain_install() WordPress Function

The is_subdomain_install() function checks whether a WordPress installation is using Subdomains or Subdirectories. This is useful for plugin developers who need to know which type of installation is being used.

is_subdomain_install() #

Whether a subdomain configuration is enabled.


Return

(bool) True if subdomain configuration is enabled, false otherwise.


Top ↑

Source

File: wp-includes/ms-load.php

function is_subdomain_install() {
	if ( defined( 'SUBDOMAIN_INSTALL' ) ) {
		return SUBDOMAIN_INSTALL;
	}

	return ( defined( 'VHOST' ) && 'yes' === VHOST );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.