allow_subdomain_install()WP 3.0.0

Allow subdomain installation

No Hooks.

Return

true|false. Whether subdomain installation is allowed

Usage

allow_subdomain_install();

Changelog

Since 3.0.0 Introduced.

allow_subdomain_install() code WP 6.5.2

function allow_subdomain_install() {
	$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
	if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' === $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) {
		return false;
	}

	return true;
}