Multisite: Replace get_blog_details()
in WP_Importer::set_blog()
with get_site()
.
Props spacedmonkey, iamfriendly. See #37102. Fixes #38345. git-svn-id: https://develop.svn.wordpress.org/trunk@38820 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
79cee7a230
commit
eeef1da9e1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user