Changeset 62026
- Timestamp:
- 03/14/2026 08:14:30 AM (less than one hour ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/users.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/users.php
r61854 r62026 144 144 } 145 145 146 // The new role of the current user must also have the promote_users cap or be a multisite super admin. 147 if ( $id === $current_user->ID 148 && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' ) 149 && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) 150 ) { 151 $update = 'err_admin_role'; 146 // The new role of the current user must also have the promote_users cap, be a multisite super admin and must not be empty. 147 if ( $id === $current_user->ID ) { 148 if ( '' === $role ) { 149 wp_die( __( 'Sorry, you cannot remove your own role.' ), 403 ); 150 } 151 152 if ( $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' ) || ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) { 152 153 continue; 154 } 155 156 $update = 'err_admin_role'; 157 continue; 153 158 } 154 159
Note: See TracChangeset
for help on using the changeset viewer.