get_clean_basedomain()
Get base domain of network.
No Hooks.
Returns
String. Base domain.
Usage
get_clean_basedomain();
Changelog
| Since 3.0.0 | Introduced. |
get_clean_basedomain() get clean basedomain code WP 7.0
function get_clean_basedomain() {
$existing_domain = network_domain_check();
if ( $existing_domain ) {
return $existing_domain;
}
$domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
$slash = strpos( $domain, '/' );
if ( $slash ) {
$domain = substr( $domain, 0, $slash );
}
return $domain;
}