Make WordPress Core

Changeset 47553


Ignore:
Timestamp:
04/07/2020 04:12:22 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Users: Pass the ID of the user that was logged out to the wp_logout action.

Props donmhico, figureone, TimothyBlynJacobs, rebasaurus.
Fixes #49533.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r47550 r47553  
    574574     */
    575575    function wp_logout() {
     576        $user_id = get_current_user_id();
     577
    576578        wp_destroy_current_session();
    577579        wp_clear_auth_cookie();
     
    579581
    580582        /**
    581          * Fires after a user is logged-out.
     583         * Fires after a user is logged out.
    582584         *
    583585         * @since 1.5.0
    584          */
    585         do_action( 'wp_logout' );
     586         * @since 5.5.0 Added the `$user_id` parameter.
     587         *
     588         * @param int $user_id ID of the user that was logged out.
     589         */
     590        do_action( 'wp_logout', $user_id );
    586591    }
    587592endif;
Note: See TracChangeset for help on using the changeset viewer.