Changeset 38457 for trunk/src/wp-includes/ms-blogs.php
- Timestamp:
- 08/31/2016 04:55:01 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-blogs.php
r38388 r38457 767 767 global $wpdb; 768 768 769 if ( empty( $new_blog ) ) 770 $new_blog = $GLOBALS['blog_id']; 771 772 $GLOBALS['_wp_switched_stack'][] = $GLOBALS['blog_id']; 769 $blog_id = get_current_blog_id(); 770 if ( empty( $new_blog ) ) { 771 $new_blog = $blog_id; 772 } 773 774 $GLOBALS['_wp_switched_stack'][] = $blog_id; 773 775 774 776 /* … … 777 779 * the extra unnecessary work 778 780 */ 779 if ( $new_blog == $ GLOBALS['blog_id']) {781 if ( $new_blog == $blog_id ) { 780 782 /** 781 783 * Fires when the blog is switched. … … 793 795 $wpdb->set_blog_id( $new_blog ); 794 796 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix(); 795 $prev_blog_id = $ GLOBALS['blog_id'];797 $prev_blog_id = $blog_id; 796 798 $GLOBALS['blog_id'] = $new_blog; 797 799 … … 801 803 global $wp_object_cache; 802 804 803 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) 805 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) { 804 806 $global_groups = $wp_object_cache->global_groups; 805 else807 } else { 806 808 $global_groups = false; 807 809 } 808 810 wp_cache_init(); 809 811 … … 849 851 global $wpdb; 850 852 851 if ( empty( $GLOBALS['_wp_switched_stack'] ) ) 853 if ( empty( $GLOBALS['_wp_switched_stack'] ) ) { 852 854 return false; 855 } 853 856 854 857 $blog = array_pop( $GLOBALS['_wp_switched_stack'] ); 855 856 if ( $GLOBALS['blog_id'] == $blog ) { 858 $blog_id = get_current_blog_id(); 859 860 if ( $blog_id == $blog ) { 857 861 /** This filter is documented in wp-includes/ms-blogs.php */ 858 862 do_action( 'switch_blog', $blog, $blog ); … … 863 867 864 868 $wpdb->set_blog_id( $blog ); 865 $prev_blog_id = $ GLOBALS['blog_id'];869 $prev_blog_id = $blog_id; 866 870 $GLOBALS['blog_id'] = $blog; 867 871 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix(); … … 872 876 global $wp_object_cache; 873 877 874 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) 878 if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) { 875 879 $global_groups = $wp_object_cache->global_groups; 876 else880 } else { 877 881 $global_groups = false; 882 } 878 883 879 884 wp_cache_init();
Note: See TracChangeset
for help on using the changeset viewer.