Make WordPress Core

Changeset 53178


Ignore:
Timestamp:
04/14/2022 06:22:37 AM (3 years ago)
Author:
audrasjb
Message:

Users: Update parameters passed to the new send_retrieve_password_email and retrieve_password_notification_email filters.

For consistency with some similar filters like send_password_change_email or send_email_change_email, and for more flexibility, pass $user_login and $user_data parameters directly to the new send_retrieve_password_email and retrieve_password_notification_email filters.

Follow-up to [52604], [52605], [52606], [52607].

Props SergeyBiryukov, costdev, peterwilsoncc.
Fixes #54690.

File:
1 edited

Legend:

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

    r53060 r53178  
    30953095     * @since 6.0.0
    30963096     *
    3097      * @param bool $send Whether to send the email.
    3098      */
    3099     if ( ! apply_filters( 'send_retrieve_password_email', true ) ) {
     3097     * @param bool    $send       Whether to send the email.
     3098     * @param string  $user_login The username for the user.
     3099     * @param WP_User $user_data  WP_User object.
     3100     */
     3101    if ( ! apply_filters( 'send_retrieve_password_email', true, $user_login, $user_data ) ) {
    31003102        return true;
    31013103    }
     
    31913193    );
    31923194
    3193     $data = compact( 'key', 'user_login', 'user_data' );
    3194 
    31953195    /**
    31963196     * Filters the contents of the reset password notification email sent to the user.
     
    32063206     *     @type string $headers The headers of the email.
    32073207     * }
    3208      * @param array $data {
    3209      *     Additional information for extenders.
    3210      *
    3211      *     @type string  $key        The activation key.
    3212      *     @type string  $user_login The username for the user.
    3213      *     @type WP_User $user_data  WP_User object.
    3214      * }
    3215      */
    3216     $notification_email = apply_filters( 'retrieve_password_notification_email', $defaults, $data );
     3208     * @type string  $key        The activation key.
     3209     * @type string  $user_login The username for the user.
     3210     * @type WP_User $user_data  WP_User object.
     3211     */
     3212    $notification_email = apply_filters( 'retrieve_password_notification_email', $defaults, $key, $user_login, $user_data );
    32173213
    32183214    if ( $switched_locale ) {
Note: See TracChangeset for help on using the changeset viewer.