By default WordPress uses a unique name χρήστη για κάθε χρήστη που είναι εγγεγραμμένος στην by clicking here.
This name is used whenever a user wishes to enter the page, making it very easy for hackers to have half the chances of success in a brute force attack if they know the name.
The following publication describes how to change the default WordPress setting so that users of your website link using their e-mail instead of the username.
To do this we will use the wp_authenticate action that runs from WorPress to authenticate the user. You should be aware that every software update from WorPress should take the same steps as described below.
Essentially we will change the $username value (which is the username that the form displays connections). So we can add the user's e-mail.
Use the following code
function email_login ($ username) {$ user = get_user_by_email ($ username); if (! empty ($ user-> user_login)) // if the email exists for a user return $ username = $ user-> user_login; // user_login or else the same string is return $ username; // returned for verification} add_action ('wp_authenticate', 'email_login');
It is important to know that this function works differently from other WordPress functions by sending the parameters as a reference point. Which means this function will be better suited to the kernel as a filter. This requires you to get the parameters, and change prices and return them.
So if the above code doesn't work check the /wp-includes/user.php file at line 54 and you will see the code
do_action_ref_array ('wp_authenticate', array (& $ credentials ['user_login'], & $ credentials ['user_password']));
Normally, the functions use the function
do_action ()
but the particular uses the function
do_action_ref_array ()
and passes through the reference values.
If it does not work for you, change the function type to
do_action ()