get_blogaddress_by_domain
Get a full blog URL, given a domain and a path.
Description
Returns (string)
Parameters (2)
- 0. $domain (string)
- The domain.
- 1. $path (string)
- The path.
Usage
if ( !function_exists( 'get_blogaddress_by_domain' ) ) { require_once ABSPATH . WPINC . '/ms-deprecated.php'; } // The domain. $domain = ''; // The path. $path = ''; // NOTICE! Understand what this does before running. $result = get_blogaddress_by_domain($domain, $path);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/ms-deprecated.php
- function get_blogaddress_by_domain( $domain, $path ) {
- _deprecated_function( __FUNCTION__, '3.7.0' );
- if ( is_subdomain_install() ) {
- $url = "http://" . $domain.$path;
- } else {
- if ( $domain != $_SERVER['HTTP_HOST'] ) {
- $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
- $url = 'http://' . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path;
- // we're not installing the main blog
- if ( $blogname != 'www.' )
- $url .= $blogname . '/';
- } else { // main blog
- $url = 'http://' . $domain . $path;
- }
- }
- return esc_url_raw( $url );
- }