]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-importer.php
WordPress 4.7.1-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-importer.php
index 408fe1bc046f509321c3734cf9ab10547eb09921..794fa5cf0d07c3ed6c198b48bbb9365ed74062be 100644 (file)
@@ -136,13 +136,15 @@ class WP_Importer {
                                fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
                                exit();
                        }
-                       if ( empty( $parsed['path'] ) )
+                       if ( empty( $parsed['path'] ) ) {
                                $parsed['path'] = '/';
-                       $blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) );
-                       if ( !$blog ) {
+                       }
+                       $blogs = get_sites( array( 'domain' => $parsed['host'], 'number' => 1, 'path' => $parsed['path'] ) );
+                       if ( ! $blogs ) {
                                fwrite( STDERR, "Error: Could not find blog\n" );
                                exit();
                        }
+                       $blog = array_shift( $blogs );
                        $blog_id = (int) $blog->blog_id;
                }