W3cubDocs

/WordPress

ms_is_switched()

Determines if switch_to_blog() is in effect

Return

(bool) True if switched, false otherwise.

Source

File: wp-includes/ms-blogs.php

function ms_is_switched() {
	return ! empty( $GLOBALS['_wp_switched_stack'] );
}

Changelog

Version Description
3.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/ms_is_switched