mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Users: Allow the role of users to be bulk changed to no role from the Users listing screen.
This option is already available when editing an individual user, but it was previously missing from the bulk actions. Props bonniebeeman, sabernhardt, ovidiul, jeroenrotty Fixes #52238 git-svn-id: https://develop.svn.wordpress.org/trunk@50228 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -114,10 +114,19 @@ switch ( $wp_list_table->current_action() ) {
|
||||
$editable_roles = get_editable_roles();
|
||||
$role = $_REQUEST['new_role'];
|
||||
|
||||
// Mocking the `none` role so we are able to save it to the database
|
||||
$editable_roles['none'] = array(
|
||||
'name' => __( '— No role for this site —' ),
|
||||
);
|
||||
|
||||
if ( ! $role || empty( $editable_roles[ $role ] ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
|
||||
}
|
||||
|
||||
if ( 'none' === $role ) {
|
||||
$role = '';
|
||||
}
|
||||
|
||||
$userids = $_REQUEST['users'];
|
||||
$update = 'promote';
|
||||
foreach ( $userids as $id ) {
|
||||
|
||||
Reference in New Issue
Block a user