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) . '
点击查看
';
$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