get_clean_basedomain

Get base domain of network.

Description

(string) get_clean_basedomain(); 

Returns (string)

Base domain.


Usage

  1. if ( !function_exists( 'get_clean_basedomain' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/network.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_clean_basedomain(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/network.php  
  1. function get_clean_basedomain() { 
  2. if ( $existing_domain = network_domain_check() ) 
  3. return $existing_domain; 
  4. $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); 
  5. if ( $slash = strpos( $domain, '/' ) ) 
  6. $domain = substr( $domain, 0, $slash ); 
  7. return $domain;