修复 WordPress 密码找回邮件在 QQ 邮箱显示链接的问题

WordPress 发的都是纯文本邮件,QQ 邮箱转成链接的时候一不留神就弄了个 amp; 出来,没办法啊,自己修呗。

把下面的代码放到插件里。

function phy25_login_init_fix_rp() {
    if(!isset($_GET['key']) && isset($_GET['amp;key'])){
        $_GET['key'] = $_GET['amp;key'];
        $_SERVER['REQUEST_URI'] = str_replace('amp;key=', 'key=', $_SERVER['REQUEST_URI']);
    }
}
add_action( 'login_init', 'phy25_login_init_fix_rp' );

另外 WordPress 默认的邮件模板其实也对普通用户不是太友好,这个只能自己改 wp-login 的邮件文案了。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.