From 2466276a8efce8e44d85b883b4648da7d7fb4d76 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 May 2019 17:18:32 +0800 Subject: [PATCH] fix registration --- functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functions.php b/functions.php index 298d240..b2c295e 100644 --- a/functions.php +++ b/functions.php @@ -831,6 +831,16 @@ function resetpassword_message_fix( $message ) { } add_filter( 'retrieve_password_message', 'resetpassword_message_fix' ); +//Fix register email bug +function new_user_message_fix( $message ) { + $show_register_ip = "注册IP | Registration IP: ".get_the_user_ip()." (".convertip(get_the_user_ip()).")\r\n\r\n如非本人操作请忽略此邮件 | Please ignore this email if this was not your operation.\r\n\r\n"; + $message = str_replace("To set your password, visit the following address:", $show_register_ip."在此设置密码 | To set your password, visit the following address:", $message); + $message = str_replace("<", "", $message); + $message = str_replace(">", "\r\n\r\n设置密码后在此登陆 | Login here after setting password: ", $message); + return $message; +} +add_filter( 'wp_new_user_notification_email', 'new_user_message_fix' ); + /* * 评论邮件回复 */