Multisite: Replace get_blog_details() in WP_Importer::set_blog() with get_site().

Props spacedmonkey, iamfriendly.
See #37102.
Fixes #38345.

Built from https://develop.svn.wordpress.org/trunk@38820


git-svn-id: http://core.svn.wordpress.org/trunk@38763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2016-10-19 05:45:31 +00:00
parent 4d44eeadd6
commit be6e98426b
2 changed files with 6 additions and 4 deletions

View 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;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38819';
$wp_version = '4.7-alpha-38820';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.