duanshangying5102 2014-03-11 09:14
浏览 51

来自wp-login页面的network_site_url()WordPress不能正常工作

$message = __('Someone requested that the password be reset for the following account:') . "

";
$message .= network_home_url( '/' ) . "

";
$message .= sprintf(__('Username: %s'), $user_login) . "

";
$message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "

";
$message .= __('To reset your password, visit the following address:') . "

";
$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">
";

The email I got link without wp-login.php

Someone requested that the password be reset for the following account:

http://localhost.com/

Username: test12

If this was a mistake, just ignore this email and nothing will happen.

To reset your password, visit the following address:

<http://localhost.com?action=rp&key=$P$Btka6BPNxTtMA2ohCF4bLMwaQ0pXHc/&login=test12>

I debugged and found that system is checking if link having wp-login.php then remove this file name from link and send mail. Is there any file in which we can check?

  • 写回答

1条回答 默认 最新

  • dongsi7759 2017-08-14 21:34
    关注

    I had the same problem. For me the solution was to parse mail as html. I added this into functions and it works now.

    function html_laiskai(){
        return "text/html";
    }
    add_filter( 'wp_mail_content_type','html_laiskai' );
    add_filter( 'wp_mail', 'html_email_encode_body' );
    function html_email_encode_body( $mail ) {
        $mail['message'] = str_replace("
    ", "<br />", $mail['message']);
        return $mail;
    }
    

    First function changes header of all emails to text/html. Second function changes the line breaks for <br /> ones.

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么