Warning: This function has been deprecated.

get_blogaddress_by_domain() WordPress Function

The get_blogaddress_by_domain() function is used to retrieve the blog address (URL) for a given domain. This is useful for sites that have multiple blogs hosted on different domains.

get_blogaddress_by_domain( string $domain, string $path ) #

Get a full blog URL, given a domain and a path.


Parameters

$domain

(string)(Required)

$path

(string)(Required)


Top ↑

Return

(string)


Top ↑

Source

File: 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 ( 'www.' !== $blogname )
				$url .= $blogname . '/';
		} else { // Main blog.
			$url = 'http://' . $domain . $path;
		}
	}
	return esc_url_raw( $url );
}


Top ↑

Changelog

Changelog
VersionDescription
3.7.0This function has been deprecated.
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.