On this page
wp_cache_switch_to_blog( int $blog_id )
Switches the internal blog ID.
Description
This changes the blog id used to create keys in blog specific groups.
See also
Parameters
$blog_idint Required-
Site ID.
Source
File: wp-includes/cache.php. View all references
function wp_cache_switch_to_blog( $blog_id ) {
global $wp_object_cache;
$wp_object_cache->switch_to_blog( $blog_id );
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Object_Cache::switch_to_blog() wp-includes/class-wp-object-cache.php | Switches the internal blog ID. |
Used By
| Used By | Description |
|---|---|
| wp_start_object_cache() wp-includes/load.php | Start the WordPress object cache. |
| switch_to_blog() wp-includes/ms-blogs.php | Switch the current blog. |
| restore_current_blog() wp-includes/ms-blogs.php | Restore the current blog, after calling switch_to_blog() . |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_cache_switch_to_blog