Users: Disallow bulk editing user roles when only one user is available#8469
Users: Disallow bulk editing user roles when only one user is available#8469audrasjb wants to merge 3 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I don't believe the number of users is the issue. The same thing occurs if you try to remove the role of your own admin account on a site where there are other users. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
I suspected this but I wanted to propose a first workaround and then investigate a bit more. |
|
I edited the PR to change the conditional: it now checks whether the current user is trying to remove their own role. |
|
The underlying problem is that there is logic for this already, in https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/users.php#L146-L153, but it only accounts for a user attempting to change their own role to one that doesn't have the I think the existing condition should be updated or extended to account for an attempt to remove the role, rather than introducing separate logic prior to iterating the list of users. |
https://core.trac.wordpress.org/ticket/63068