Code Duplication    Length = 21-21 lines in 2 locations

src/wp-includes/ms-blogs.php 2 locations

@@ 829-849 (lines=21) @@
826
	$prev_blog_id = $blog_id;
827
	$GLOBALS['blog_id'] = $new_blog;
828
829
	if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
830
		wp_cache_switch_to_blog( $new_blog );
831
	} else {
832
		global $wp_object_cache;
833
834
		if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
835
			$global_groups = $wp_object_cache->global_groups;
836
		} else {
837
			$global_groups = false;
838
		}
839
		wp_cache_init();
840
841
		if ( function_exists( 'wp_cache_add_global_groups' ) ) {
842
			if ( is_array( $global_groups ) ) {
843
				wp_cache_add_global_groups( $global_groups );
844
			} else {
845
				wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) );
846
			}
847
			wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );
848
		}
849
	}
850
851
	if ( did_action( 'init' ) ) {
852
		$wp_roles = new WP_Roles();
@@ 902-922 (lines=21) @@
899
	$GLOBALS['blog_id'] = $blog;
900
	$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
901
902
	if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
903
		wp_cache_switch_to_blog( $blog );
904
	} else {
905
		global $wp_object_cache;
906
907
		if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) {
908
			$global_groups = $wp_object_cache->global_groups;
909
		} else {
910
			$global_groups = false;
911
		}
912
913
		wp_cache_init();
914
915
		if ( function_exists( 'wp_cache_add_global_groups' ) ) {
916
			if ( is_array( $global_groups ) ) {
917
				wp_cache_add_global_groups( $global_groups );
918
			} else {
919
				wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'site-details' ) );
920
			}
921
			wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );
922
		}
923
	}
924
925
	if ( did_action( 'init' ) ) {