May 2017
Beginner to intermediate
536 pages
14h 25m
English
We have defined a function call on the init action to call the login_user function. This function is responsible for handling the login form submission and authenticating the users into the application. Let's take a look at the form submission handling part of the login_user function:
public function login_user() { global $wpwaf_login_params; $errors = array(); if ( $_POST['wpwaf_login_submit'] ) { $username = isset ( $_POST['wpwaf_username'] ) ? $_POST['wpwaf_username'] : ''; $password = isset ( $_POST['wpwaf_password'] ) ? $_POST['wpwaf_password'] : ''; if ( empty( $username ) ) array_push( $errors, __('Please enter a username.','wpwaf') ); if ( empty( $password ) ) array_push( $errors, __('Please ...Read now
Unlock full access