WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#19134 closed enhancement (fixed)

Update the user role hook to include old roles.

Reported by: awellis13 Owned by: SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.2.1
Component: Role/Capability Keywords: has-patch commit 3.4-early
Focuses: Cc:

Description

While developing a plugin I needed to see the transition in roles. This is because I am delaying the sending of the new user welcome email until a certain role has been set. So I want to see if a certain role existed before when setting the new role. If yes, send the email.

Of course, I could hook on earlier in the actions and cache the current user's role, but it would be much easier if the old roles were passed into "set_user_role".

Attached is a diff of the change.

Attachments (1)

roleaction.diff (708 bytes) - added by awellis13 6 years ago.

Download all attachments as: .zip

Change History (6)

@awellis13
6 years ago

#1 @devinreams
6 years ago

  • Cc devin@… added

#2 @nacin
6 years ago

  • Keywords commit 3.4-early added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 3.3 to 3.2.1

Reminded me of the previous change here: #14708.

Looks good.

#3 @eddiemoya
5 years ago

  • Cc eddie.moya+wptrac@… added

#4 @wonderboymusic
5 years ago

  • Milestone changed from Future Release to 3.6

#5 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 23358:

Pass old roles to set_user_role action. props awellis13. fixes #19134.

Note: See TracTickets for help on using tickets.