Don't read from the switched global. Instead use _wp_switched_stack. switched is retained for back compat and should not be directly read since it is prone to stompage by plugins. see #21459
git-svn-id: http://core.svn.wordpress.org/trunk@22015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ebb2967466
commit
7915172568
|
@ -520,7 +520,7 @@ function switch_to_blog( $new_blog, $deprecated = null ) {
|
|||
function restore_current_blog() {
|
||||
global $wpdb, $wp_roles;
|
||||
|
||||
if ( ! $GLOBALS['switched'] )
|
||||
if ( empty( $GLOBALS['_wp_switched_stack'] ) )
|
||||
return false;
|
||||
|
||||
$blog = array_pop( $GLOBALS['_wp_switched_stack'] );
|
||||
|
@ -580,7 +580,7 @@ function restore_current_blog() {
|
|||
* @return bool True if switched, false otherwise.
|
||||
*/
|
||||
function ms_is_switched() {
|
||||
return $GLOBALS['switched'];
|
||||
return ! empty( $GLOBALS['_wp_switched_stack'] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue