Add wp_authenticate_user filter

git-svn-id: http://svn.automattic.com/wordpress/trunk@6685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-01-29 20:17:11 +00:00
parent a5246f532f
commit 19de78b638
1 changed files with 6 additions and 0 deletions

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.'));