On this page
do_action( 'switch_blog', int $new_blog_id, int $prev_blog_id, string $context )
Fires when the blog is switched.
Parameters
$new_blog_idint-
New blog ID.
$prev_blog_idint-
Previous blog ID.
$contextstring-
Additional context. Accepts
'switch'when called from switch_to_blog() or'restore'when called from restore_current_blog() .
Source
File: wp-includes/ms-blogs.php. View all references
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
Related
Used By
| Used By | Description |
|---|---|
| switch_to_blog() wp-includes/ms-blogs.php | Switch the current blog. |
| restore_current_blog() wp-includes/ms-blogs.php | Restore the current blog, after calling switch_to_blog() . |
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | MU (3.0.0) |
| 5.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/switch_blog