[wp-trac] [WordPress Trac] #23290: When using switch_to_blog() with a persistent object cache that lacks wp_cache_switch_to_blog() support, non-persistent groups are not maintained

WordPress Trac noreply at wordpress.org
Sat Mar 14 19:22:32 UTC 2026


#23290: When using switch_to_blog() with a persistent object cache that lacks
wp_cache_switch_to_blog() support, non-persistent groups are not maintained
-------------------------------------------------+-------------------------
 Reporter:  markjaquith                          |       Owner:
                                                 |  johnjamesjacoby
     Type:  defect (bug)                         |      Status:  closed
 Priority:  low                                  |   Milestone:  7.0
Component:  Cache API                            |     Version:  3.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing 2nd-opinion  |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by westonruter):

 In [changeset:"62028" 62028]:
 {{{
 #!CommitTicketReference repository="" revision="62028"
 Cache API: Address code quality issues with `wp_cache_switch_to_blog()`.

 This addresses 3 PHPStan errors at rule level 8:

 * `arguments.count`: Function `wp_cache_switch_to_blog_fallback()` invoked
 with 1 parameter, 0 required.
 * `method.nonObject`: Cannot call method `switch_to_blog()` on `class-
 string|object`.
 * `missingType.return`: Function `wp_cache_switch_to_blog()` has no return
 type specified.

 Developed as subset of https://github.com/WordPress/wordpress-
 develop/pull/11151

 Follow-up to r61760.

 Props westonruter, johnjamesjacoby.
 See #23290, #64238.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/23290#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list