Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/wp-includes/link-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -3495,9 +3495,15 @@ function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
if ( empty( $blog_id ) || ! is_multisite() ) {
$url = get_option( 'siteurl' );
} else {
switch_to_blog( $blog_id );
$url = get_option( 'siteurl' );
restore_current_blog();
// Use WP_Site_Query to get the site URL.
$site = get_site( $blog_id );

$url = $site->domain . $site->path;

// If the network has a custom domain, use that instead.
if ( \get_network()->domain !== $site->domain ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why \ use here? Code did not use it in any code references

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my bad. It's in my fingers, add them automatically because I always use namespace. I'll remove it i a few sec.

$url = get_network()->domain . $site->path;
}
}

$url = set_url_scheme( $url, $scheme );
Expand Down