WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp authenticate

Contents

Description

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

Parameters

$username
(string) (required) User's username
Default: None
$password
(string) (required) User's password
Default: None

Return Values

(mixed) 
Returns WP_User object if login successful, otherwise WP_Error object.

Errors can be verified with is_wp_error()

Change Log

Since: 2.5.0

Source File

wp_authenticate() is located in wp-includes/pluggable.php