W3cubDocs

/WordPress

get_clean_basedomain()

Get base domain of network.

Description

Return

(string) Base domain.

Source

File: wp-admin/includes/network.php

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;
}

Changelog

Version Description
3.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_clean_basedomain