WordPress.org

Make WordPress Core

Ticket #20825: main-blog-while-activation-user.patch

File main-blog-while-activation-user.patch, 640 bytes (added by rahal.aboulfeth, 6 years ago)
  • wp-includes/ms-settings.php

    diff -r 0f439c53f704 wp-includes/ms-settings.php
    a b  
    115115
    116116        if ( ! $blog_id ) {
    117117                if ( defined( 'WP_INSTALLING' ) ) {
    118                         $current_blog->blog_id = $blog_id = 1;
     118                        // in multisite, the main blog may not be always the first one!!
     119                        $current_blog->blog_id = $blog_id = ( defined('BLOG_ID_CURRENT_SITE') ? BLOG_ID_CURRENT_SITE : 1 ) ;
    119120                } else {
    120121                        wp_load_translations_early();
    121122                        $msg = ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ? ' ' . __( 'Database tables are missing.' ) : '';