Changeset 1307

Show
Ignore:
Timestamp:
05/23/08 11:53:11 (5 months ago)
Author:
donncha
Message:

Cache fixes when creating a new blog

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/wpmu-functions.php

    r1304 r1307  
    11711171        if ( is_array($meta) ) foreach ($meta as $key => $value) { 
    11721172                update_blog_status( $blog_id, $key, $value ); 
    1173                 update_blog_option( $blog_id, $key, $value ); 
    1174         } 
    1175  
    1176         add_blog_option( $blog_id, 'WPLANG', get_site_option( 'WPLANG' ) ); 
    1177  
    1178         update_blog_option( $blog_id, 'blog_public', $meta['public'] ); 
     1173                update_option( $blog_id, $key, $value ); 
     1174        } 
     1175 
     1176        add_option( $blog_id, 'WPLANG', get_site_option( 'WPLANG' ) ); 
     1177 
     1178        update_option( $blog_id, 'blog_public', $meta['public'] ); 
    11791179        delete_blog_option( $blog_id, 'public' ); 
    11801180 
     
    11821182                update_usermeta( $user_id, 'primary_blog', $blog_id ); 
    11831183 
     1184 
     1185        restore_current_blog(); 
    11841186 
    11851187        do_action( 'wpmu_new_blog', $blog_id, $user_id ); 
     
    12681270        $wp_roles->_init(); 
    12691271        // fix url. 
    1270         wp_cache_delete('notoptions', 'options'); 
    1271         wp_cache_delete('alloptions', 'options'); 
    12721272        update_option('siteurl', $url); 
    12731273        update_option('home', $url); 
     
    12751275        update_option('upload_path', "wp-content/blogs.dir/" . $blog_id . "/files"); 
    12761276        update_option('blogname', $blog_title); 
    1277  
     1277        update_option('admin_email', ''); 
    12781278        $wpdb->query("UPDATE $wpdb->options SET option_value = '' WHERE option_name = 'admin_email'"); 
    12791279 
     
    13011301        $wpdb->query( "DELETE FROM ".$wpdb->usermeta." WHERE meta_key = '".$table_prefix."user_level'" ); 
    13021302        $wpdb->query( "DELETE FROM ".$wpdb->usermeta." WHERE meta_key = '".$table_prefix."capabilities'" ); 
     1303 
     1304        wp_cache_delete('notoptions', 'options'); 
     1305        wp_cache_delete('alloptions', 'options'); 
    13031306 
    13041307        $wpdb->suppress_errors( false );