Permalink
Browse files

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
  • Loading branch information...
1 parent 4ce88d3 commit f11317881a634857236c18ac928ad1ddd5e01904 Ryan Boren committed Aug 22, 2012
Showing with 7 additions and 7 deletions.
  1. +6 −6 wp-includes/ms-blogs.php
  2. +1 −1 wp-includes/ms-settings.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,15 +515,15 @@ 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'] );
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'];
}
/**
@@ -127,7 +127,7 @@
$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();

0 comments on commit f113178

Please sign in to comment.