Un motore di ricerca WordPress per sviluppatori e autori di temi



get_blogaddress_by_name ›

Da3.0.0
Deprecaton/a
get_blogaddress_by_name ( $blogname )
Parametri:
  • (string) $blogname The (subdomain or directory) name
    Richiesto:
Ritorna:
  • (string)
Definito a:
Codex:
ChangeLog:
  • MU

Get a full blog URL, given a blog name.



Sorgenti

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