WP_Object_Cache::switch_to_blog()publicWP 3.5.0

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 6.5.2

public function switch_to_blog( $blog_id ) {
	$blog_id           = (int) $blog_id;
	$this->blog_prefix = $this->multisite ? $blog_id . ':' : '';
}