LLMS_Person_Handler::get_login_fields( string $layout = 'columns' )

Get the fields for the login form


Parameters Parameters

$layout

(string) (Optional) Form layout. Accepts "columns" (default) or "stacked".

Default value: 'columns'


Top ↑

Return Return

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


Top ↑

Source Source

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

	public static function get_login_fields( $layout = 'columns' ) {

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

		/**
		 * Customize the fields used to build the user login form
		 *
		 * @since 3.0.0
		 * @param array[] $fields An array of form field arrays.
		 */
		return apply_filters(
			'lifterlms_person_login_fields',
			array(
				array(
					'columns'     => ( 'columns' == $layout ) ? 6 : 12,
					'id'          => 'llms_login',
					'label'       => ! $usernames ? __( 'Email Address', 'lifterlms' ) : __( 'Username or Email Address', 'lifterlms' ),
					'last_column' => ( 'columns' == $layout ) ? false : true,
					'required'    => true,
					'type'        => ! $usernames ? 'email' : 'text',
				),
				array(
					'columns'     => ( 'columns' == $layout ) ? 6 : 12,
					'id'          => 'llms_password',
					'label'       => __( 'Password', 'lifterlms' ),
					'last_column' => ( 'columns' == $layout ) ? true : true,
					'required'    => true,
					'type'        => 'password',
				),
				array(
					'columns'     => ( 'columns' == $layout ) ? 3 : 12,
					'classes'     => 'llms-button-action',
					'id'          => 'llms_login_button',
					'value'       => __( 'Login', 'lifterlms' ),
					'last_column' => ( 'columns' == $layout ) ? false : true,
					'required'    => false,
					'type'        => 'submit',
				),
				array(
					'columns'     => ( 'columns' == $layout ) ? 6 : 6,
					'id'          => 'llms_remember',
					'label'       => __( 'Remember me', 'lifterlms' ),
					'last_column' => false,
					'required'    => false,
					'type'        => 'checkbox',
				),
				array(
					'columns'         => ( 'columns' == $layout ) ? 3 : 6,
					'id'              => 'llms_lost_password',
					'last_column'     => true,
					'description'     => '<a href="' . esc_url( llms_lostpassword_url() ) . '">' . __( 'Lost your password?', 'lifterlms' ) . '</a>',
					'type'            => 'html',
					'wrapper_classes' => 'align-right',
				),
			)
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Remove usage of the deprecated lifterlms_registration_generate_username.
3.0.4 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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