wp_login


wp_login ( $username, $password, $deprecated = '' )

Parameters:
  • (string) $username User's username
  • (string) $password User's password
  • (string) $deprecated Not used
See:
Returns:
  • (bool) False on login failure, true on successful check
Defined at:

Description

Checks a users login information and logs them in if it checks out. This function is deprecated.

Use the global $error to get the reason why the login failed. If the username is blank, no error will be set, so assume blank username on that case.

Plugins extending this function should also provide the global $error and set what the error is, so that those checking the global for why there was a failure can utilize it later.

Related Functions

wp_loginout, wp_login_url, wp_login_form, wp_clone, wp_logout

Top Google Results

User discussions

wpseek mobile