diff --git src/wp-admin/includes/class-wp-users-list-table.php src/wp-admin/includes/class-wp-users-list-table.php
index 018654bdd2..107fb308ed 100644
|
|
class WP_Users_List_Table extends WP_List_Table { |
295 | 295 | <select name="<?php echo $id; ?>" id="<?php echo $id; ?>"> |
296 | 296 | <option value=""><?php _e( 'Change role to…' ); ?></option> |
297 | 297 | <?php wp_dropdown_roles(); ?> |
| 298 | <option value="none"><?php esc_html_e( '— No role for this site —' ); ?></option> |
298 | 299 | </select> |
299 | 300 | <?php |
300 | 301 | submit_button( __( 'Change' ), '', $button_id, false ); |
diff --git src/wp-admin/users.php src/wp-admin/users.php
index 3742e95276..ed2756fcd2 100644
|
|
switch ( $wp_list_table->current_action() ) { |
119 | 119 | $role = $_REQUEST['new_role']; |
120 | 120 | } |
121 | 121 | |
122 | | if ( ! $role || empty( $editable_roles[ $role ] ) ) { |
| 122 | // Set role to empty string if no role option is selected. |
| 123 | if ( 'none' === $role ) { |
| 124 | $role = ''; |
| 125 | } |
| 126 | |
| 127 | if ( ! empty( $role ) && empty( $editable_roles[ $role ] ) ) { |
123 | 128 | wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 ); |
124 | 129 | } |
125 | 130 | |