Make WordPress Core

Ticket #39985: action-retrieve-password.patch

File action-retrieve-password.patch, 821 bytes (added by bonus369, 7 years ago)

Code for add do_action before sending email to recover password

  • wp-login.php

    diff --git a/wp-login.php b/wp-login.php
    index cc9b9c3..03422b3 100644
    a b function retrieve_password() { 
    370370         * @param WP_User $user_data  WP_User object.
    371371         */
    372372        $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
    373        
    374         /**
    375          * Fires before send email of retrieve password.
    376          *
    377          * @since 4.7.3
    378          *
    379          * @param string  $key        The activation key.
    380          * @param WP_User $user_data  WP_User object.
    381          */
    382         do_action( 'before_send_mail_retrieve_password', $key, $user_data );
    383373
    384374        if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) )
    385375                wp_die( __('The email could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') );