Can you tell me a function to insert in the functions.php
file to remove the login via username option?
I would like the user to be able to log in only with his registered email.
Can you tell me a function to insert in the functions.php
file to remove the login via username option?
I would like the user to be able to log in only with his registered email.
Share Improve this question edited Sep 16, 2019 at 13:16 Matthew Brown aka Lord Matt 1,0683 gold badges13 silver badges34 bronze badges asked Sep 16, 2019 at 11:45 Matteo FeduziMatteo Feduzi 291 silver badge9 bronze badges 4 |1 Answer
Reset to default 0In default-filters you'll see
// Default authentication filters
add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );
so you just need to
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20 );
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745153200a4613960.html
authenticate
: codex.wordpress/Plugin_API/Filter_Reference/authenticate – Matthew Brown aka Lord Matt Commented Sep 16, 2019 at 12:08mu-plugin
or a normal plugin. It'll be just as fast, except now it'll work for all themes, and can be copied between sites easily. Putting functionality like this inside a theme is very bad practice, themes should only contain visuals/styles/templates – Tom J Nowell ♦ Commented Sep 16, 2019 at 13:17