Make WordPress Core

Changeset 55164


Ignore:
Timestamp:
01/31/2023 08:44:58 AM (15 months ago)
Author:
audrasjb
Message:

Users: Add context to the send_auth_cookies filter.

This changeset adds $user_id, $expire, $expiration and $token parameters to provide context to send_auth_cookies hook, which allows the filter to skip sending auth cookies.

Props dd32, mukesh27, costdev, peterwilsoncc, audrasjb.
Fixes #56971.
See #39367.

File:
1 edited

Legend:

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

    r55161 r55164  
    10731073         *
    10741074         * @param bool $send Whether to send auth cookies to the client.
    1075          */
    1076         if ( ! apply_filters( 'send_auth_cookies', true ) ) {
     1075         * @since 6.2.0 The `$user_id`, `$expire`, `$expiration` and, `$token` parameters were added.
     1076         *
     1077         * @param bool   $send       Whether to send auth cookies to the client.
     1078         * @param int    $user_id    User ID. Zero when clearing cookies.
     1079         * @param int    $expire     The time the login grace period expires as a UNIX timestamp.
     1080         *                           Zero when clearing cookies.
     1081         * @param int    $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp.
     1082         *                           Default is 14 days from now. Zero when clearing cookies.
     1083         * @param string $token      User's session token to use for this cookie. Empty string when clearing cookies.
     1084         */
     1085        if ( ! apply_filters( 'send_auth_cookies', true, $user_id, $expire, $expiration, $token ) ) {
    10771086            return;
    10781087        }
     
    11021111
    11031112        /** This filter is documented in wp-includes/pluggable.php */
    1104         if ( ! apply_filters( 'send_auth_cookies', true ) ) {
     1113        if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '' ) ) {
    11051114            return;
    11061115        }
Note: See TracChangeset for help on using the changeset viewer.