From f11317881a634857236c18ac928ad1ddd5e01904 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 Aug 2012 03:34:00 +0000 Subject: [PATCH] Resurrect the switched global. Some are still using it. see #21459 git-svn-id: http://core.svn.wordpress.org/trunk@21581 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-blogs.php | 12 ++++++------ wp-includes/ms-settings.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index df86a0c58a..be61c34faa 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -462,7 +462,7 @@ function switch_to_blog( $new_blog, $deprecated = null ) { * the extra unnecessary work */ if ( $new_blog == $GLOBALS['blog_id'] ) { do_action( 'switch_blog', $new_blog, $new_blog ); - $GLOBALS['_wp_switched'] = true; + $GLOBALS['switched'] = true; return true; } @@ -499,7 +499,7 @@ function switch_to_blog( $new_blog, $deprecated = null ) { } do_action( 'switch_blog', $new_blog, $prev_blog_id ); - $GLOBALS['_wp_switched'] = true; + $GLOBALS['switched'] = true; return true; } @@ -515,7 +515,7 @@ function switch_to_blog( $new_blog, $deprecated = null ) { function restore_current_blog() { global $wpdb, $wp_roles; - if ( ! $GLOBALS['_wp_switched'] ) + if ( ! $GLOBALS['switched'] ) return false; $blog = array_pop( $GLOBALS['_wp_switched_stack'] ); @@ -523,7 +523,7 @@ function restore_current_blog() { if ( $GLOBALS['blog_id'] == $blog ) { do_action( 'switch_blog', $blog, $blog ); // If we still have items in the switched stack, consider ourselves still 'switched' - $GLOBALS['_wp_switched'] = ! empty( $GLOBALS['_wp_switched_stack'] ); + $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] ); return true; } @@ -562,7 +562,7 @@ function restore_current_blog() { do_action( 'switch_blog', $blog, $prev_blog_id ); // If we still have items in the switched stack, consider ourselves still 'switched' - $GLOBALS['_wp_switched'] = ! empty( $GLOBALS['_wp_switched_stack'] ); + $GLOBALS['switched'] = ! empty( $GLOBALS['_wp_switched_stack'] ); return true; } @@ -575,7 +575,7 @@ function restore_current_blog() { * @return bool True if switched, false otherwise. */ function ms_is_switched() { - return $GLOBALS['_wp_switched']; + return $GLOBALS['switched']; } /** diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php index fe5350079a..af2ea0d97a 100644 --- a/wp-includes/ms-settings.php +++ b/wp-includes/ms-settings.php @@ -127,7 +127,7 @@ $wpdb->set_prefix( $table_prefix, false ); // $table_prefix can be set in sunris $wpdb->set_blog_id( $current_blog->blog_id, $current_blog->site_id ); $table_prefix = $wpdb->get_blog_prefix(); $_wp_switched_stack = array(); -$_wp_switched = false; +$switched = false; // need to init cache again after blog_id is set wp_start_object_cache();