A WordPress-centric search engine for devs and theme authors



get_clean_basedomain ›

Since3.0.0
Deprecatedn/a
get_clean_basedomain ( No parameters )
Returns:
  • (string) Base domain.
Defined at:
Codex:

Get base domain of network.



Source

function get_clean_basedomain() {
	if ( $existing_domain = network_domain_check() ) {
		return $existing_domain;
	}
	$domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
	if ( $slash = strpos( $domain, '/' ) ) {
		$domain = substr( $domain, 0, $slash );
	}
	return $domain;
}