Changeset 61760 for trunk/src/wp-includes/cache-compat.php
- Timestamp:
- 02/27/2026 07:57:26 PM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/cache-compat.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cache-compat.php
r60697 r61760 313 313 } 314 314 endif; 315 316 if ( ! function_exists( 'wp_cache_switch_to_blog' ) ) : 317 /** 318 * Used when switch_to_blog() and restore_current_blog() are called, but 319 * only when a persistent object cache drop-in plugin has omitted the 320 * wp_cache_switch_to_blog() function that was introduced in 3.5.0. 321 * 322 * @link https://core.trac.wordpress.org/ticket/23290 323 * 324 * @since 7.0.0 325 * 326 * @global WP_Object_Cache $wp_object_cache Object cache global instance. 327 * 328 * @param int $blog_id Site ID. 329 */ 330 function wp_cache_switch_to_blog( $blog_id ) { 331 global $wp_object_cache; 332 333 // Attempt to use the drop-in object cache method if it exists. 334 if ( method_exists( $wp_object_cache, 'switch_to_blog' ) ) { 335 $wp_object_cache->switch_to_blog( $blog_id ); 336 return; 337 } 338 339 /* 340 * Perform a fallback blog switch, which will reinitialize the caches 341 * for the new blog ID. 342 */ 343 wp_cache_switch_to_blog_fallback( $blog_id ); 344 } 345 endif;
Note: See TracChangeset
for help on using the changeset viewer.