switch_to_blog
switch_to_blog ( $new_blog_id, $deprecated = null )
Parameters:- (int) new_blog_id The ID of the blog to switch to. Default: current blog.
- (bool) deprecated Not used.
See:Returns:- (true) Always returns true.
Defined at:Change Log: - Introduced in WordPress: —
- Deprecated in WordPress: —
Description
Switch the current blog.This function is useful if you need to pull posts, or other information,
from other blogs. You can switch back afterwards using restore_current_blog().
Things that aren't switched:
- plugins. See #14941