WP_Object_Cache::switch_to_blog()
Switches the internal blog ID.
This changes the blog ID used to create keys in blog specific groups.
Method of the class: WP_Object_Cache{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WP_Object_Cache = new WP_Object_Cache(); $WP_Object_Cache->switch_to_blog( $blog_id );
- $blog_id(int) (required)
- Blog ID.
Changelog
Since 3.5.0 | Introduced. |
WP_Object_Cache::switch_to_blog() WP Object Cache::switch to blog code WP 6.8
public function switch_to_blog( $blog_id ) { $blog_id = (int) $blog_id; $this->blog_prefix = $this->multisite ? $blog_id . ':' : ''; }