WordPress at a glance
action is not described

switch_blog action-hook . WP 3.0.0

Fires when the blog is switched.

Usage

add_action( 'switch_blog', 'action_function_name_242', 10, 3 );
function action_function_name_242( $new_blog_id, $prev_blog_id, $context ){
	// action...
}
$new_blog_id(int)
New blog ID.
$prev_blog_id(int)
Previous blog ID.
$context(string)
Additional context. Accepts 'switch' when called from switch_to_blog() or 'restore' when called from restore_current_blog().

Changelog

Since 3.0.0 Introduced.
Since 5.4.0 The $context parameter was added.

Where the hook is called

switch_to_blog()
switch_blog
restore_current_blog()
switch_blog
wp-includes/ms-blogs.php 518
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
wp-includes/ms-blogs.php 550
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'switch' );
wp-includes/ms-blogs.php 583
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );
wp-includes/ms-blogs.php 617
do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );

Where in WP core the hook is used

wp-includes/class-wp-roles.php 360
remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );
wp-includes/class-wp-roles.php 364
add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );
wp-includes/ms-default-filters.php 36
add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );
wp-includes/ms-site.php 947
remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );
wp-includes/ms-site.php 957
add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );