[wp-trac] [WordPress Trac] #35488: wp_logout() not working as it should

WordPress Trac noreply at wordpress.org
Thu Nov 21 19:13:41 UTC 2019


#35488: wp_logout() not working as it should
--------------------------------------+-----------------------------
 Reporter:  sebastian.pisula          |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.3
Component:  Users                     |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by figureone):

 This fix has changed behavior in the `wp_logout` filter. Prior to
 WordPress 5.3, plugin developers could use `get_current_user_id()` inside
 the hook to get the ID of the user logging out.
 https://github.com/WordPress/WordPress/blob/master/wp-
 includes/pluggable.php#L566-L582

 For example, in a plugin that links external authentication services (like
 Google, LDAP, CAS) we use it to log the user out of their external
 account.

 Maybe we can add a `pre_wp_logout` hook at the beginning of the
 `wp_logout()` function for cases where we need to refer to the logging out
 user?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/35488#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list