正常的作者通知模板太不友好了,看到标题,你永远不知道内容是什么。所以需要修改下这个,让它最好在标题就告诉你评论的内容。
文件位置在:wp-includes/pluggable.php
打开之后定位到New comment on your post "%s"这句话,然后将这段修改为下面:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
default: // Comments $notify_message = sprintf( __( $comment_content )) . "\r\n\r\n"; /* translators: %s: post title */ $notify_message .= sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n"; /* translators: 1: comment author's name, 2: comment author's IP address, 3: comment author's hostname */ $notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: comment author email */ $notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n"; /* translators: %s: trackback/pingback/comment author URL */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; /* translators: %s: comment text */ $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n"; $notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n"; /* translators: Comment notification email subject. 1: Site title, 2: Post title */ $subject = sprintf( __( '[%1$s] %2$s Comment: "%3$s"' ), $blogname, $comment_content, $post->post_title ); break; |
这样就会在邮件的标题以及正文第一句提示评论的内容了。






最新评论
站长您好,亚马逊云咨询推广资源,望建立联系,可邮件,谢谢。
换友情链接吗?
看你的站做的挺不错的
恭喜!!太强了,硕博连读啊
雁过留毛,人过留名。
看不懂但大受震撼
每天都在战争,希望2026和平.
ZeroTier 看过多篇帖子,目前群辉、飞牛os、win11 、安卓、ubuntu ≥18.04 顺利通过,这篇相对于简单 实用、特来感谢 🙄