• LifterLMS
  • Knowledge Base
  • Academy
  • Blog
  • Podcast
  • Contributors
  • My Account

LifterLMS LifterLMS

  • Code Reference
  • REST API
  • LLMS-CLI

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Code Reference / Classes / LLMS_Controller_Account / LLMS_Controller_Account::reset_password()

LLMS_Controller_Account::reset_password()

Handle form submission of the Reset Password form

Contents

  • Description
  • Return
  • Source
  • Related
    • Uses
  • Changelog
  • User Contributed Notes

Description #Description

This is the form that actually updates a users password.


Top ↑

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.


Top ↑

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


Top ↑

Related #Related

Uses #Uses

Uses
Uses Description
includes/forms/controllers/class.llms.controller.account.php: LLMS_Controller_Account::reset_password_handler()

Handle the submission of the password reset form.

includes/functions/llms-functions-wrappers.php: llms_redirect_and_exit()

Redirect and exit

includes/functions/llms.functions.notice.php: llms_add_notice()

Stores notice in llms_notices session

includes/functions/llms.functions.page.php: llms_get_page_url()

Retrieve the URL for a LifterLMS Page.


Top ↑

Changelog #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.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

© 2014 - 2023 LifterLMS · Privacy Policy · Terms and Conditions

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.