W3cubDocs

/WordPress

ms_is_switched(): bool

Determines if switch_to_blog() is in effect.

Return

bool True if switched, false otherwise.

Source

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

Changelog

Version Description
3.5.0 Introduced.

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