get_blogaddress_by_domain( string $domain, string $path ): string

In this article

This function has been deprecated.

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

Parameters

$domainstringrequired
$pathstringrequired

Return

string

Source

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 sanitize_url( $url );
}

Changelog

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

User Contributed Notes

You must log in before being able to contribute a note or feedback.