LLMS_Person_Handler::get_lost_password_fields()

Retrieve fields for password recovery


Description Description

Used to generate the form where a username/email is entered to start the password reset process.


Top ↑

Return Return

(array[]) An array of form field arrays.


Top ↑

Source Source

File: includes/class.llms.person.handler.php

	public static function get_lost_password_fields() {

		$usernames = LLMS_Forms::instance()->are_usernames_enabled();

		if ( ! $usernames ) {
			$message = __( 'Lost your password? Enter your email address and we will send you a link to reset it.', 'lifterlms' );
		} else {
			$message = __( 'Lost your password? Enter your username or email address and we will send you a link to reset it.', 'lifterlms' );
		}

		/**
		 * Filter the message displayed on the lost password form.
		 *
		 * @since Unknown.
		 *
		 * @param string $message The message displayed before the form.
		 */
		$message = apply_filters( 'lifterlms_lost_password_message', $message );

		/**
		 * Filter the form fields displayed for the lost password form.
		 *
		 * @since 3.8.0
		 *
		 * @param array[] $fields An array of form field arrays.
		 */
		return apply_filters(
			'lifterlms_lost_password_fields',
			array(
				array(
					'id'    => 'llms_lost_password_message',
					'type'  => 'html',
					'value' => $message,
				),
				array(
					'id'       => 'llms_login',
					'label'    => ! $usernames ? __( 'Email Address', 'lifterlms' ) : __( 'Username or Email Address', 'lifterlms' ),
					'required' => true,
					'type'     => ! $usernames ? 'email' : 'text',
				),
				array(
					'classes' => 'llms-button-action auto',
					'id'      => 'llms_lost_password_button',
					'value'   => __( 'Reset Password', 'lifterlms' ),
					'type'    => 'submit',
				),
			)
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Use LLMS_Forms::are_usernames_enabled() in favor of deprecated option "lifterlms_registration_generate_username". Remove field values set to the default value for a form field.
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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