Codex tools: Log in
wp-includes/deprecated.php.
Use any of these functions instead.Contents |
Checks a user's login information and logs them in if it checks out.
<?php wp_login( $username, $password, $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.
Login Tags:
is_user_logged_in(),
wp_login_form(),
wp_loginout(),
wp_logout(),
wp_register()
Login URLs:
wp_login_url(),
wp_logout_url(),
wp_lostpassword_url()