On this page
get_blogaddress_by_domain( string $domain, string $path ): string
This function has been deprecated.
Get a full blog URL, given a domain and a path.
Parameters
$domainstring Required$pathstring Required
Return
string
Source
File: wp-includes/ms-deprecated.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| sanitize_url() wp-includes/formatting.php | Sanitizes a URL for database or redirect usage. |
| is_subdomain_install() wp-includes/ms-load.php | Whether a subdomain configuration is enabled. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Changelog
| Version | Description |
|---|---|
| 3.7.0 | This function has been deprecated. |
| MU (3.0.0) | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_blogaddress_by_domain