#32060 closed enhancement (fixed)
Add actions for add_role() and remove_role()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.3 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Role/Capability | Keywords: | good-first-bug has-patch commit |
| Focuses: | Cc: |
Description
set_user_role() has an action which is nice for audit purposes. It would be great if add_role() and remove_role() had similar actions to make sure there aren't any leaky spots in the audit log.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core by shooper. View the logs.
11 years ago
#5
@
11 years ago
- Focuses docs removed
- Keywords commit added
- Owner changed from SergeyBiryukov to shooper
32060.2.diff adjusts the hook docs syntax and adds @since versions for 4.3.
#6
@
11 years ago
All hooks in WordPress with the word "added" or "deleted" use it as a prefix, not a suffix. Verb + noun is pretty common for us. I'm going to change this to added_user_role and removed_user_role.
#7
@
11 years ago
Consistency!
- I was going to change
$this->idto$this, butset_user_roleuses$this->id.
- I was going to change these to
added_user_roleandremoved_user_role, but to matchset_user_role, I'm going to go withadd_user_roleandremove_user_roleinstead.
This ticket was mentioned in Slack in #meta by sergey. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
Thanks for submitting this Daniel. It's something that was bothering me too. I've created the patch for it.