ms_is_switched() WordPress Function

The ms_is_switched() function is used to check if a WordPress site is in a switched state. This function will return true if the site is switched, and false otherwise. This function is useful for plugin and theme developers who need to know if a site is switched.

ms_is_switched() #

Determines if switch_to_blog() is in effect


Return

(bool) True if switched, false otherwise.


Top ↑

Source

File: wp-includes/ms-blogs.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.