diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-05-23 11:53:11 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-05-23 11:53:11 +0000 |
commit | a3051709afd14748a874b6bb47c39005ec7e347e (patch) | |
tree | 93460f7416326f31c241ceb6827faa3a94144e7d | |
parent | 9f7e83e519a5c1aabdb95f62f97ae79e863a23fe (diff) | |
download | wordpress-mu-a3051709afd14748a874b6bb47c39005ec7e347e.tar.gz wordpress-mu-a3051709afd14748a874b6bb47c39005ec7e347e.tar.xz wordpress-mu-a3051709afd14748a874b6bb47c39005ec7e347e.zip |
Cache fixes when creating a new blog
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1307 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r-- | wp-includes/wpmu-functions.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index 241646f..9d65006 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1170,18 +1170,20 @@ function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id if ( is_array($meta) ) foreach ($meta as $key => $value) { update_blog_status( $blog_id, $key, $value ); - update_blog_option( $blog_id, $key, $value ); + update_option( $blog_id, $key, $value ); } - add_blog_option( $blog_id, 'WPLANG', get_site_option( 'WPLANG' ) ); + add_option( $blog_id, 'WPLANG', get_site_option( 'WPLANG' ) ); - update_blog_option( $blog_id, 'blog_public', $meta['public'] ); + update_option( $blog_id, 'blog_public', $meta['public'] ); delete_blog_option( $blog_id, 'public' ); if(get_usermeta( $user_id, 'primary_blog' ) == 1 ) update_usermeta( $user_id, 'primary_blog', $blog_id ); + restore_current_blog(); + do_action( 'wpmu_new_blog', $blog_id, $user_id ); return $blog_id; @@ -1267,14 +1269,12 @@ function install_blog($blog_id, $blog_title = '') { populate_roles(); $wp_roles->_init(); // fix url. - wp_cache_delete('notoptions', 'options'); - wp_cache_delete('alloptions', 'options'); update_option('siteurl', $url); update_option('home', $url); update_option('fileupload_url', $url . "files" ); update_option('upload_path', "wp-content/blogs.dir/" . $blog_id . "/files"); update_option('blogname', $blog_title); - + update_option('admin_email', ''); $wpdb->query("UPDATE $wpdb->options SET option_value = '' WHERE option_name = 'admin_email'"); // Default category @@ -1301,6 +1301,9 @@ function install_blog($blog_id, $blog_title = '') { $wpdb->query( "DELETE FROM ".$wpdb->usermeta." WHERE meta_key = '".$table_prefix."user_level'" ); $wpdb->query( "DELETE FROM ".$wpdb->usermeta." WHERE meta_key = '".$table_prefix."capabilities'" ); + wp_cache_delete('notoptions', 'options'); + wp_cache_delete('alloptions', 'options'); + $wpdb->suppress_errors( false ); } |