LLMS_Controller_Account::reset_password()
Handle form submission of the Reset Password form
Description Description
This is the form that actually updates a users password.
Return Return
(null|WP_Error|true) Returns null for nonce errors or when the form hasn't been submitted, an error object when errors are encountered, and true on success.
Source Source
File: includes/forms/controllers/class.llms.controller.account.php
public function reset_password() {
$result = $this->reset_password_handler();
if ( ! $result ) {
return null;
} elseif ( is_wp_error( $result ) ) {
llms_add_notice( implode( '<br>', $result->get_error_messages() ), 'error' );
return $result;
}
// Success.
llms_add_notice( __( 'Your password has been updated.', 'lifterlms' ) );
llms_redirect_and_exit( add_query_arg( 'password-reset', 1, llms_get_page_url( 'myaccount' ) ) );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.0.0 | Refactored to move reset logic into it's own method. |
| 4.21.0 | Use addslashes() and FILTER_UNSAFE_RAW to mimic magic quotes behavior of the WP core reset flow. |
| 3.8.0 | |
| 3.37.17 | Use WP core functions in favor of their (deprecated) LifterLMS clones. |
| 3.35.0 | Introduced. |