Use get_sites in get_blog_details#3928
Conversation
| if ( ! $get_all ) { | ||
| wp_cache_set( $blog_id . $all, $details, 'blog-details' ); | ||
| return $details; | ||
| } |
There was a problem hiding this comment.
@felixarntz Pretty sure that this is not needed anymore
if ( get_current_blog_id() !== $blog_id ) {
switch_to_blog( $blog_id );
$switched_blog = true;
}
$details->blogname = get_option( 'blogname' );
$details->siteurl = get_option( 'siteurl' );
$details->post_count = get_option( 'post_count' );
$details->home = get_option( 'home' );
if ( $switched_blog ) {
restore_current_blog();
}
as this is done here.
wordpress-develop/src/wp-includes/class-wp-site.php
Lines 319 to 352 in b74cfa8
felixarntz
left a comment
There was a problem hiding this comment.
@spacedmonkey While technically speaking the changes here look reasonable, I believe they do not address the main problem voiced in https://core.trac.wordpress.org/ticket/40228#comment:33.
A fix for this was already committed 5 years ago but then reverted due to this feedback. Therefore we must not ignore it. It looks like we need to keep supporting the existing cache groups in order to make this change in a way that does not break backward compatibility for larger multisites that rely on this caching to work.
I made that mistake in https://core.trac.wordpress.org/changeset/41719, and we should not repeat it here.
Trac ticket: https://core.trac.wordpress.org/ticket/40228
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.