diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-10 10:59:10 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-10 10:59:10 +0000 |
commit | 4c2a5729289e8786c9505d9842129be0dd167668 (patch) | |
tree | 977dd0d1d3a1f2bc380ebe4e8b0dd436917fc432 /wp-admin | |
parent | af5a0181bdaaad674d8e3bacb28d787a19eaefc0 (diff) | |
download | wordpress-mu-4c2a5729289e8786c9505d9842129be0dd167668.tar.gz wordpress-mu-4c2a5729289e8786c9505d9842129be0dd167668.tar.xz wordpress-mu-4c2a5729289e8786c9505d9842129be0dd167668.zip |
Allow users to change their primary blog
Update primary_blog when blogs are added to user account, but only if primary_blog is 1. fixes #433
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1065 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
-rw-r--r-- | wp-admin/wpmu-edit.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php index 5765f75..1a7f868 100644 --- a/wp-admin/wpmu-edit.php +++ b/wp-admin/wpmu-edit.php @@ -146,6 +146,8 @@ switch( $_REQUEST[ 'action' ] ) { $blog_id = wpmu_create_blog($newdomain, $path, wp_specialchars( $blog['title'] ), $user_id ,'', $current_site->id); $wpdb->show_errors(); if( !is_wp_error($blog_id) ) { + if( get_user_option( $user_id, 'primary_blog' ) == 1 ) + update_user_option( $user_id, 'primary_blog', $blog_id, true ) $content_mail = sprintf(__("New blog created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain.$path, wp_specialchars($blog['title']) ); @wp_mail( get_site_option('admin_email'), sprintf(__('[%s] New Blog Created'), $current_site->site_name), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); wp_redirect( add_query_arg( "updated", "blogadded", $_SERVER[ 'HTTP_REFERER' ] ) ); |