Make WordPress Core


Ignore:
Timestamp:
10/19/2016 05:44:21 AM (9 years ago)
Author:
jeremyfelt
Message:

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-importer.php

    r35170 r38820  
    137137                exit();
    138138            }
    139             if ( empty( $parsed['path'] ) )
     139            if ( empty( $parsed['path'] ) ) {
    140140                $parsed['path'] = '/';
    141             $blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) );
    142             if ( !$blog ) {
     141            }
     142            $blogs = get_sites( array( 'domain' => $parsed['host'], 'number' => 1, 'path' => $parsed['path'] ) );
     143            if ( ! $blogs ) {
    143144                fwrite( STDERR, "Error: Could not find blog\n" );
    144145                exit();
    145146            }
     147            $blog = array_shift( $blogs );
    146148            $blog_id = (int) $blog->blog_id;
    147149        }
Note: See TracChangeset for help on using the changeset viewer.