WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp login


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Contents

Description

Checks a user's login information and logs them in if it checks out.

Replace With

Usage

 <?php  wp_login$username$password$deprecated ); ?> 

Parameters

$username 
(string) User's username
$password 
(string) User's password
$deprecated 
(string) Not used

Return

(bool) 
False on login failure, true on successful check

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.

Examples

Notes

Change Log

  • Since: 1.2.2
  • Deprecated: 2.5
  • Replaced By: wp_signon()

Related

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(), wp_registration_url()

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.