diff --git a/includes/core/class-password.php b/includes/core/class-password.php index a839458e..1b3e5ee4 100644 --- a/includes/core/class-password.php +++ b/includes/core/class-password.php @@ -271,6 +271,10 @@ if ( ! class_exists( 'um\core\Password' ) ) { } if ( $this->is_reset_request() ) { + $form_data = array( + 'mode' => 'password', + ); + UM()->form()->post_form = wp_unslash( $_POST ); if ( empty( UM()->form()->post_form['mode'] ) ) { @@ -278,47 +282,43 @@ if ( ! class_exists( 'um\core\Password' ) ) { } /** - * UM hook + * Fires for handle validate errors on the reset password form submit. * - * @type action - * @title um_reset_password_errors_hook - * @description Action on reset password submit form - * @input_vars - * [{"var":"$post","type":"array","desc":"Form submitted"}] - * @change_log - * ["Since: 2.0"] - * @usage add_action( 'um_reset_password_errors_hook', 'function_name', 10, 1 ); - * @example - * Make any custom validation on password reset form. + * function my_reset_password_errors( $submission_data, $form_data ) { * // your code here * } - * ?> + * add_action( 'um_reset_password_errors_hook', 'my_reset_password_errors', 10, 2 ); */ - do_action( 'um_reset_password_errors_hook', UM()->form()->post_form ); + do_action( 'um_reset_password_errors_hook', UM()->form()->post_form, $form_data ); if ( ! isset( UM()->form()->errors ) ) { /** - * UM hook + * Fires for handle the reset password form when submitted data is valid. * - * @type action - * @title um_reset_password_process_hook - * @description Action on reset password success submit form - * @input_vars - * [{"var":"$post","type":"array","desc":"Form submitted"}] - * @change_log - * ["Since: 2.0"] - * @usage add_action( 'um_reset_password_process_hook', 'function_name', 10, 1 ); - * @example - * Make any custom action when password reset form is submitted. + * function my_reset_password_process( $submission_data, $form_data ) { * // your code here * } - * ?> + * add_action( 'um_reset_password_process_hook', 'my_reset_password_process', 10, 2 ); */ - do_action( 'um_reset_password_process_hook', UM()->form()->post_form ); + do_action( 'um_reset_password_process_hook', UM()->form()->post_form, $form_data ); } }