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

LifterLMS LifterLMS

  • Code Reference
  • REST API
  • LLMS-CLI
  • Changelog Subscribe

Code Reference

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

LLMS_Controller_Login::login()

Handle Login Form Submission

Contents

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

Return #Return

(void)


Top ↑

Source #Source

File: includes/forms/controllers/class.llms.controller.login.php

	public function login() {

		if ( ! llms_verify_nonce( '_llms_login_user_nonce', 'llms_login_user' ) ) {
			return;
		}

		$login = LLMS_Person_Handler::login( $_POST );

		// Validation or login issues.
		if ( is_wp_error( $login ) ) {
			foreach ( $login->get_error_messages() as $msg ) {
				llms_add_notice( $msg, 'error' );
			}
			return;
		}

		$redirect = isset( $_POST['redirect'] ) ? llms_filter_input( INPUT_POST, 'redirect', FILTER_SANITIZE_URL ) : get_permalink( llms_get_page_id( 'myaccount' ) );

		llms_redirect_and_exit( apply_filters( 'lifterlms_login_redirect', $redirect, $login ) );

	}

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.login.php: lifterlms_login_redirect

User Login Form Controller

includes/llms.functions.core.php: llms_verify_nonce()

Verify nonce with additional checks to confirm request method

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

Redirect and exit

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

Gets a specific external variable by name and optionally filters it

includes/class.llms.person.handler.php: LLMS_Person_Handler::login()

Login a user

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

Stores notice in llms_notices session

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

Retrieve the WordPress Page ID of a LifterLMS Core Page.

Show 2 more uses Hide more uses

Top ↑

Changelog #Changelog

Changelog
Version Description
3.35.0 Sanitize $_POST data.
3.19.4 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

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

© 2014 - 2025 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.