Show Role in profile and user edit. Don't allow users with edit_users caps to demote themselves. Props: davidhouse, ringmaster. fixes #1825

git-svn-id: https://develop.svn.wordpress.org/trunk@2995 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-11-06 03:58:52 +00:00
parent 1fb12a1eaa
commit c244bfd360
4 changed files with 31 additions and 1 deletions
+6 -1
View File
@@ -59,7 +59,12 @@ function wp_insert_user($userdata) {
update_usermeta( $user_id, 'jabber', $jabber );
update_usermeta( $user_id, 'aim', $aim );
update_usermeta( $user_id, 'yim', $yim );
if ($update && !empty($role)) {
$user = new WP_User($user_id);
$user->set_role($role);
}
if ( !$update ) {
$user = new WP_User($user_id);
$user->set_role(get_settings('default_role'));