mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-15 00:34:33 +00:00
Allow a different role to be set for users when they are created in a call to wp_insert_user(). Fixes #9891 props Denis-de-Bernardy.
git-svn-id: https://develop.svn.wordpress.org/trunk@11442 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -211,12 +211,10 @@ function wp_insert_user($userdata) {
|
||||
update_usermeta( $user_id, 'admin_color', $admin_color);
|
||||
update_usermeta( $user_id, 'use_ssl', $use_ssl);
|
||||
|
||||
if ( $update && isset($role) ) {
|
||||
if ( isset($role) ) {
|
||||
$user = new WP_User($user_id);
|
||||
$user->set_role($role);
|
||||
}
|
||||
|
||||
if ( !$update ) {
|
||||
} elseif ( !$update ) {
|
||||
$user = new WP_User($user_id);
|
||||
$user->set_role(get_option('default_role'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user