|Username not the same as blog address||2006-10-28 14:10||
How annoying that creating new blog also makes a user with the same name.
When you create a new blog in WordPress MU (mutli-user), it asks you for blog address, blog title, and admin email. When you submit the form, along with a new blog being created, also a new user is created with matching username (username = blog address). Not everybody likes it that way and with the following 5 minute modification, you can create blogs where the username is not the same as the blog address.
First, add a username field to the form where you create blogs.
Right above this line: (in my file it’s line 567):
insert this line:
Then to receive/process the variable after you submit the
form, edit the file that processes the form.
In the case ‘addblog’, right below this line:
$blog = $_POST['blog'];
Insert this line:
$username = wp_specialchars($blog['username'] );
Then change the line that says
$user_id = wpmu_create_user($domain, $password, $email );
$user_id = wpmu_create_user( $username, $password, $email );
This website is powered by Wordpress