修改/禁用WordPress登录错误的提示信息

我们都知道,当WordPress登录信息不正确的时候,会出现错误提示,如下图所示:

login-erro-wpdaxue_com

如果你要修改这些提示信息,可以将下面的代码添加到WordPress主题的 functions.php 文件中:

function failed_login() {
    return '自定义错误提示信息';
}
add_filter('login_errors', 'failed_login');

如果出于安全考虑,不想在登录错误的时候显示错误提示信息,可以在主题的 functions.php 文件添加下面的代码:

add_filter('login_errors', create_function('$a', "return null;"));

参考资料:http://wpdaily.co/top-10-snippets/

来源:

https://www.wpdaxue.com/modify-wordpress-login-error-message.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32472.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?