diff --git a/wp-includes/comment.php b/wp-includes/comment.php index d0223b7666..ef1f90b7f5 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -263,6 +263,10 @@ class WP_Comment_Query { $approved = "comment_approved = '0'"; elseif ( 'approve' == $status ) $approved = "comment_approved = '1'"; + elseif ( 'all' == $status ) + $approved = "( comment_approved = '0' OR comment_approved = '1' )"; + elseif ( 'full' == $status ) + $approved = '0 = 0'; elseif ( ! empty( $status ) ) $approved = $wpdb->prepare( "comment_approved = %s", $status ); else diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 5ea0fea108..f2c5e8d263 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -476,12 +476,6 @@ function switch_to_blog( $new_blog, $deprecated = null ) { $prev_blog_id = $GLOBALS['blog_id']; $GLOBALS['blog_id'] = $new_blog; - if ( did_action( 'init' ) ) { - $wp_roles->reinit(); - $current_user = wp_get_current_user(); - $current_user->for_blog( $new_blog ); - } - if ( function_exists( 'wp_cache_switch_to_blog' ) ) { wp_cache_switch_to_blog( $new_blog ); } else { @@ -503,6 +497,12 @@ function switch_to_blog( $new_blog, $deprecated = null ) { } } + if ( did_action( 'init' ) ) { + $wp_roles->reinit(); + $current_user = wp_get_current_user(); + $current_user->for_blog( $new_blog ); + } + do_action( 'switch_blog', $new_blog, $prev_blog_id ); $GLOBALS['switched'] = true; @@ -537,12 +537,6 @@ function restore_current_blog() { $GLOBALS['blog_id'] = $blog; $GLOBALS['table_prefix'] = $wpdb->prefix; - if ( did_action( 'init' ) ) { - $wp_roles->reinit(); - $current_user = wp_get_current_user(); - $current_user->for_blog( $blog ); - } - if ( function_exists( 'wp_cache_switch_to_blog' ) ) { wp_cache_switch_to_blog( $blog ); } else { @@ -564,6 +558,12 @@ function restore_current_blog() { } } + if ( did_action( 'init' ) ) { + $wp_roles->reinit(); + $current_user = wp_get_current_user(); + $current_user->for_blog( $blog ); + } + do_action( 'switch_blog', $blog, $prev_blog_id ); // If we still have items in the switched stack, consider ourselves still 'switched'