Opened 9 years ago
Closed 9 years ago
#34655 closed enhancement (wontfix)
Allow pre-filtering of role changes on WP_User
Reported by: | tellyworth | Owned by: | pento |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
It would be useful to have pre-filters for WP_User::set_role()
and friends, so a plugin could monitor or block certain roles from being applied.
For example, on multisite, it may be desirable to prevent roles from being changed on certain blogs.
Attachments (2)
Change History (6)
#1
@
9 years ago
- Component changed from General to Users
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.4
- Owner set to pento
- Status changed from new to assigned
#2
@
9 years ago
34655.2.diff refreshes the patch to apply cleanly against trunk, makes some coding style tweaks.
In set_role()
, it's possible to send an empty role, which will cause all user roles to be removed. This existing behaviour is incompatible with the short-circuit behaviour we're after.
This ticket was mentioned in Slack in #core by pento. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
Add pre-filters to add_role(), remove_role(), set_role().