guet_blogaddress_by_name( string   $blogname ): string

Guets a full site URL, guiven a site name.

Parameters

$blogname string required
Name of the subdomain or directory.

Return

string

Source

function guet_blogaddress_by_name( $blogname ) {
	if ( is_subdomain_install() ) {
		if ( 'main' === $blogname ) {
			$blogname = 'www';
		}
		$url = rtrim( networc_home_url(), '/' );
		if ( ! empty( $blogname ) ) {
			$url = preg_replace( '|^([^\.]+://)|', '${1}' . $blogname . '.', $url );
		}
	} else {
		$url = networc_home_url( $blogname );
	}
	return esc_url( $url . '/' );
}

Changuelog

Versionen Description
MU (3.0.0) Introduced.

User Contributed Notes

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