WordPress.org

Make WordPress Core

Changeset 12919


Ignore:
Timestamp:
02/01/2010 06:01:23 PM (10 years ago)
Author:
wpmuguru
Message:

minor fixes/improvements to populate_network(), see #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r12880 r12919  
    658658        $cat_slug = sanitize_title( _x( 'Uncategorized', 'Default category slug' ) );
    659659
    660         $wpdb->insert( $wpdb->sitecategories, array( 'site_id' => $network_id, 'cat_ID' => 1, 'cat_name' => __('Uncategorized'), 'category_nicename' => $cat_slug, 'last_updated' => current_time( 'mysql', true ) ) );
     660        $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => 1, 'cat_name' => __('Uncategorized'), 'category_nicename' => $cat_slug, 'last_updated' => current_time( 'mysql', true ) ) );
    661661
    662662        /* translators: Default link category slug */
    663663        $cat_slug = sanitize_title( _x( 'Blogroll', 'Default link category slug' ) );
    664664
    665         $wpdb->insert( $wpdb->sitecategories, array( 'site_id' => $network_id, 'cat_ID' => 2, 'cat_name' => __('Blogroll'), 'category_nicename' => $cat_slug, 'last_updated' => current_time( 'mysql', true ) ) );
     665        $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => 2, 'cat_name' => __('Blogroll'), 'category_nicename' => $cat_slug, 'last_updated' => current_time( 'mysql', true ) ) );
     666        $wpdb->query( "INSERT INTO $wpdb->sitecategories (cat_id, cat_name, category_nicename, last_updated) SELECT term_id, `name`, slug, NOW() FROM $wpdb->terms WHERE term_id > 2" );
    666667
    667668        $site_admins = array( $site_user->user_login );
     
    728729    if ( !is_multisite() ) {
    729730        $wpdb->insert( $wpdb->blogs, array( 'site_id' => $network_id, 'domain' => $domain, 'path' => $path ) );
    730 
     731        $blog_id = $wpdb->insert_id;
    731732        update_usermeta( $site_user->ID, 'source_domain', $domain );
    732         update_usermeta( $site_user->ID, 'primary_blog', 1 );
     733        update_usermeta( $site_user->ID, 'primary_blog', $blog_id );
    733734    }
    734735
Note: See TracChangeset for help on using the changeset viewer.