mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Authentication: Allow users to log in using their email address.
Introduces `wp_authenticate_email_password()` which is hooked into `authenticate` after `wp_authenticate_username_password()`. Props Denis-de-Bernardy, ericlewis, vhomenko, MikeHansenMe, swissspidy, ocean90. Fixes #9568. git-svn-id: https://develop.svn.wordpress.org/trunk@36617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -548,7 +548,7 @@ if ( !function_exists('wp_authenticate') ) :
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $username User's username.
|
||||
* @param string $username User's username or email address.
|
||||
* @param string $password User's password.
|
||||
* @return WP_User|WP_Error WP_User object if the credentials are valid,
|
||||
* otherwise WP_Error.
|
||||
@@ -575,7 +575,7 @@ function wp_authenticate($username, $password) {
|
||||
if ( $user == null ) {
|
||||
// TODO what should the error message be? (Or would these even happen?)
|
||||
// Only needed if all authentication handlers fail to return anything.
|
||||
$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
|
||||
$user = new WP_Error( 'authentication_failed', __( '<strong>ERROR</strong>: Invalid username, email address or incorrect password.' ) );
|
||||
}
|
||||
|
||||
$ignore_codes = array('empty_username', 'empty_password');
|
||||
|
||||
Reference in New Issue
Block a user