From a6cecef42f22ab635684052e0d3011e5d985e1d3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 19 Nov 2019 10:01:04 +0000 Subject: [PATCH] Login and Registration: Pass `$user_data` parameter to the `lostpassword_post` action in `retrieve_password()`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Props wpgurudev, pagewidth, lukecavanagh, johnbillion, kkarpieszuk. Fixes #38334. Built from https://develop.svn.wordpress.org/trunk@46749 git-svn-id: http://core.svn.wordpress.org/trunk@46549 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-login.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 5d1d04f990..9e7a4c3a80 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46748'; +$wp_version = '5.4-alpha-46749'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index ace097d9c0..a82bb75734 100644 --- a/wp-login.php +++ b/wp-login.php @@ -363,7 +363,8 @@ function wp_login_viewport_meta() { * @return bool|WP_Error True: when finish. WP_Error on error */ function retrieve_password() { - $errors = new WP_Error(); + $errors = new WP_Error(); + $user_data = false; if ( empty( $_POST['user_login'] ) || ! is_string( $_POST['user_login'] ) ) { $errors->add( 'empty_username', __( 'ERROR: Enter a username or email address.' ) ); @@ -382,11 +383,13 @@ function retrieve_password() { * * @since 2.1.0 * @since 4.4.0 Added the `$errors` parameter. + * @since 5.4.0 Added the `$user_data` parameter. * * @param WP_Error $errors A WP_Error object containing any errors generated * by using invalid credentials. + * @param WP_User|false WP_User object if found, false if the user does not exist. */ - do_action( 'lostpassword_post', $errors ); + do_action( 'lostpassword_post', $errors, $user_data ); if ( $errors->has_errors() ) { return $errors;