From ba538147c1f4771b556d1554c3d306a0443bafcd Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 2 Dec 2020 09:49:11 -0300 Subject: [PATCH] Update `lostpassword_post` action and add missing parameter `lostpassword_post` is a WP action that is duplicated in WooCommerce to replicate the functionality to retrieve user password in the 'My Account' pages. WP recently added the variable `$user_data` as a second parameter to this action (https://github.com/WordPress/WordPress/commit/a6cecef42f22ab635684052e0d3011e5d985e1d3). This commit simply copies this change to the version of the action that we maintain. Similar to what was done in 1a99235dc85193b43b43e03fa225aef9a69fde89 when a first parameter as added to the action in WP and we had to do the same in WC core. --- includes/shortcodes/class-wc-shortcode-my-account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/shortcodes/class-wc-shortcode-my-account.php b/includes/shortcodes/class-wc-shortcode-my-account.php index 270d70ab854..b61d1697ed0 100644 --- a/includes/shortcodes/class-wc-shortcode-my-account.php +++ b/includes/shortcodes/class-wc-shortcode-my-account.php @@ -293,7 +293,7 @@ class WC_Shortcode_My_Account { $errors = new WP_Error(); - do_action( 'lostpassword_post', $errors ); + do_action( 'lostpassword_post', $errors, $user_data ); if ( $errors->get_error_code() ) { wc_add_notice( $errors->get_error_message(), 'error' );