仅通过电子邮件登录,不使用用户名

时间:2019-09-16 作者:Matteo Feduzi

你能告诉我在functions.php 要删除通过用户名登录选项的文件?

我希望用户只能使用其注册的电子邮件登录。

1 个回复
SO网友:Rup

在里面default-filters 你会看到的

// Default authentication filters
add_filter( \'authenticate\', \'wp_authenticate_username_password\', 20, 3 );
add_filter( \'authenticate\', \'wp_authenticate_email_password\', 20, 3 );
所以你只需要

remove_filter( \'authenticate\', \'wp_authenticate_username_password\', 20 );