函数原型
get_blogaddress_by_domain( string $domain, string $path ): string
函数描述
Get a full blog URL, given a domain and a path.
是否弃用
Warning: This function has been deprecated.
函数参数
-
$domain
string
Required -
$path
string
Required
函数返回值
string
函数位置
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 sanitize_url( $url );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.7.0 | This function has been deprecated. |
| MU (3.0.0) | Introduced. |

