wp_switch_roles_and_user

Advertisement

Summery Summery

Switches the initialized roles and current user capabilities to another site.

Syntax Syntax

wp_switch_roles_and_user( int $new_site_id, int $old_site_id )

Parameters Parameters

$new_site_id

(int) (Required) New site ID.

$old_site_id

(int) (Required) Old site ID.

Source Source

File: wp-includes/ms-blogs.php

	/** This filter is documented in wp-includes/ms-blogs.php */
	do_action( 'switch_blog', $new_blog_id, $prev_blog_id, 'restore' );

	// If we still have items in the switched stack, consider ourselves still 'switched'.
	$GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] );

	return true;
}

/**
 * Switches the initialized roles and current user capabilities to another site.
 *

Advertisement

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.