Add wp_authenticate_user filter

git-svn-id: https://develop.svn.wordpress.org/trunk@6685 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-01-29 20:17:11 +00:00
parent 2b2a48cbb5
commit 70bd86e708

View File

@@ -438,6 +438,12 @@ function wp_authenticate($username, $password) {
return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.'));
}
$user = apply_filters('wp_authenticate_user', $user, $password);
if ( is_wp_error($user) ) {
do_action( 'wp_login_failed', $username );
return $user;
}
if ( !wp_check_password($password, $user->user_pass) ) {
do_action( 'wp_login_failed', $username );
return new WP_Error('incorrect_password', __('<strong>ERROR</strong>: Incorrect password.'));