On this page
WP_Object_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.
Parameters
$blog_idint Required-
Blog ID.
Source
File: wp-includes/class-wp-object-cache.php. View all references
public function switch_to_blog( $blog_id ) {
$blog_id = (int) $blog_id;
$this->blog_prefix = $this->multisite ? $blog_id . ':' : '';
}
Related
Used By
| Used By | Description |
|---|---|
| wp_cache_switch_to_blog() wp-includes/cache.php | Switches the internal blog ID. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_object_cache/switch_to_blog