Skip to content

Improve optimisations of get_site_url#5054

Closed
soderlind wants to merge 3 commits intoWordPress:trunkfrom
soderlind:improve/get_site_url
Closed

Improve optimisations of get_site_url#5054
soderlind wants to merge 3 commits intoWordPress:trunkfrom
soderlind:improve/get_site_url

Conversation

@soderlind
Copy link
Copy Markdown

Improve optimisations of get_site_url() by not using switch_to_blog, instead use the WP_Site_Query query

Trac ticket: https://core.trac.wordpress.org/ticket/59173

$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.

@soderlind
Copy link
Copy Markdown
Author

Duplicate of https://core.trac.wordpress.org/ticket/64863, i.e 64863 fixes this and more.

@soderlind soderlind closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants