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:
parent
bd9784b05e
commit
d251d8b6c4
@ -211,12 +211,10 @@ function wp_insert_user($userdata) {
|
|||||||
update_usermeta( $user_id, 'admin_color', $admin_color);
|
update_usermeta( $user_id, 'admin_color', $admin_color);
|
||||||
update_usermeta( $user_id, 'use_ssl', $use_ssl);
|
update_usermeta( $user_id, 'use_ssl', $use_ssl);
|
||||||
|
|
||||||
if ( $update && isset($role) ) {
|
if ( isset($role) ) {
|
||||||
$user = new WP_User($user_id);
|
$user = new WP_User($user_id);
|
||||||
$user->set_role($role);
|
$user->set_role($role);
|
||||||
}
|
} elseif ( !$update ) {
|
||||||
|
|
||||||
if ( !$update ) {
|
|
||||||
$user = new WP_User($user_id);
|
$user = new WP_User($user_id);
|
||||||
$user->set_role(get_option('default_role'));
|
$user->set_role(get_option('default_role'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user