V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
tsxiaochen
V2EX  ›  WordPress

wordpress 评论邮件通知,邮件中的文章链接获取或错如何解决?

  •  
  •   tsxiaochen · 2021-03-12 13:10:30 +08:00 · 912 次点击
    这是一个创建于 1133 天前的主题,其中的信息可能已经有所发展或是发生改变。
    comment_parent ? $comment->comment_parent : ''; $spam_confirmed = $comment->comment_approved; if (($parent_id != '') && ($spam_confirmed != 'spam')) { $wp_email = '[email protected]' . preg_replace('#^www.#', '', strtolower($_SERVER['SERVER_NAME'])); //e-mail 发出点, no-reply 可改为可用的 e-mail. $to = trim(get_comment($parent_id)->comment_author_email); $subject = '[' . get_option("blogname") . '] 您的留言有了新回复'; $message = '

    ' . trim(get_comment($parent_id)->comment_author) . ', 您好!

    您曾在《' . get_the_title($comment->comment_post_ID) . '》的留言:

    ' . trim(get_comment($parent_id)->comment_content) . '

    ' . trim($comment->comment_author) . ' 给您的回复:

    ' . trim($comment->comment_content) . '

    点击查看

    此邮件由系统自动发送,请勿回复

    © ' . get_option('blogname') . '

    '; $from = "From: \"" . get_option('blogname') . "\" <$wp_email>"; $headers = "$from\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n"; wp_mail( $to, $subject, $message, $headers ); } } add_action('comment_post', 'comment_mail_notify'); ?>

    . htmlspecialchars(get_comment_link($parent_id)) .获取的文章链接错误,没有带栏目名称。 网站固定连接 /%category%/%post_id%.html 邮件中获取的链接为域名 /post_id.html

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3563 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 04:38 · PVG 12:38 · LAX 21:38 · JFK 00:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.