get_blogaddress_by_domain()
最后更新于:2021-11-26 05:53:22
get_blogaddress_by_domain( string$domain, string$path)Get a full blog URL, given a domain and a path.
参数
- $domain
-
(string) (Required)
- $path
-
(string) (Required)
响应
(string)
源文件
文件: gc-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 );
}