switch_to_blog


switch_to_blog ( $new_blog, $deprecated = null )

Parameters:
  • (int) $new_blog The id of the blog you want to switch to. Default: current blog
  • (bool) $deprecated Deprecated argument
See:
Returns:
  • (true) Always returns True.
Defined at:
Change Log:
  • M: U

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

Related Functions

switch_to_locale, wp_cache_switch_to_blog, switch_theme, the_custom_logo, the_author_login

Top Google Results

User discussions

wpseek mobile