WP_Object_Cache::switch_to_blog
Switches the internal blog ID.
This changes the blog ID used to create keys in blog specific groups.
Метод класса: WP_Object_Cache{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WP_Object_Cache = new WP_Object_Cache(); $WP_Object_Cache->switch_to_blog( $blog_id );
- $blog_id(int) (обязательный)
- Blog ID.
Список изменений
| С версии 3.5.0 | Введена. |
Код WP_Object_Cache::switch_to_blog() WP Object Cache::switch to blog WP 6.9.1
public function switch_to_blog( $blog_id ) {
$blog_id = (int) $blog_id;
$this->blog_prefix = $this->multisite ? $blog_id . ':' : '';
}