WordPress at a glance
function is not described

wp_cache_switch_to_blog() WP 3.5.0

Switches the internal blog ID.

This changes the blog id used to create keys in blog specific groups.

No Hooks.

Return

null. Nothing.

Usage

wp_cache_switch_to_blog( $blog_id );
$blog_id(int) (required)
Site ID.

Notes

  • See: WP_Object_Cache::switch_to_blog()
  • Global. WP_Object_Cache. $wp_object_cache Object cache global instance.

Changelog

Since 3.5.0 Introduced.

Code of wp_cache_switch_to_blog() WP 5.7.2

<?php
function wp_cache_switch_to_blog( $blog_id ) {
	global $wp_object_cache;

	$wp_object_cache->switch_to_blog( $blog_id );
}