Opened 5 years ago
Closed 5 years ago
#49533 closed defect (bug) (fixed)
Add user ID to wp_logout action
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | Users | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
As pointed out by @figureone, after #35488, the logged out user's id is no longer accessible when the wp_logout
action is fired.
I think it would be a good idea to get the current user's id before starting the logout and then passing that id to the logout filter. As @figureone pointed out, the clear_auth_cookie
hook can be used as a stop-gap, but I think the change is still valuable since the two aren't equivalent actions. Auth cookies are cleared in other places, not just when the user is logging out.
Attachments (2)
Change History (8)
#4
@
5 years ago
49533.2.diff is different compared to 49533.patch as it tries to follow the suggested approach by @TimothyBlynJacobs.
Note: See
TracTickets for help on using
tickets.
This is actually what we did manually, after a report of an incompatibility with another plugin (User Switching) after we switched from the
wp_logout
toclear_auth_cookie
hook. Now we grab the user ID inclear_auth_cookie
, and then reference it inwp_logout
.https://github.com/uhm-coe/authorizer/commit/30d902be01f17d414fc18179cfb3e84a916499f4
https://github.com/uhm-coe/authorizer/issues/91
Adding user ID as a param to
wp_logout
would simplify this for us.