MENU

wordpress评论回复代码

//评论邮件通知
function comment_mail_notify($comment_id) {
$comment = get_comment($comment_id);
$parent_id = $comment->comment_parent ? $comment->comment_parent : '';
$spam_confirmed = $comment->comment_approved;
if (($parent_id != '') && ($spam_confirmed != 'spam')) {
$wp_email = 'no-reply@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));//发件人e-mail地址
$to = trim(get_comment($parent_id)->comment_author_email);
$subject = '你在 [' . get_the_title($comment->comment_post_ID) . '] 的评论有回复啦 by:' . get_option('blogname') . '';
$message = '
<div id="isForwardContent"><div style="color:#555;font:12px/1.5 微软雅黑,Tahoma,Helvetica,Arial,sans-serif;none">
<table border="0" cellspacing="0" cellpadding="0">
</table>
<div>
<h2 style="border-bottom:1px solid #e9e9e9;font-size:14px;font-weight:normal;padding:10px 0 10px;"><span style="color: #12ADDB">&gt; </span>您在 <a style="text-decoration:none;color: #12ADDB;" href="' . get_option('home') . '" title="' . get_option('blogname') . '" target="_blank">' . get_option('blogname') . '</a> 中的留言有回复啦!</h2>
<div style="font-size:13px;color:#777;margin-top:18px">' . trim(get_comment($parent_id)->comment_author) . ' 同学,您曾在《 ' . get_the_title($comment->comment_post_ID) . ' 》中发表评论:

Read More