comment_notification_notify_author
云策文档标注
概述
comment_notification_notify_author 是一个 WordPress 过滤器,用于控制是否通知评论作者关于他们自己帖子上的评论。默认情况下,WordPress 不会发送此类通知,此过滤器允许开发者覆盖此行为。
关键要点
- 过滤器名称:comment_notification_notify_author
- 用途:决定是否向评论作者发送其在自己帖子上的评论通知
- 默认值:false(不通知)
- 参数:$notify(布尔值,是否通知,默认 false)和 $comment_id(字符串,评论 ID)
- 相关函数:wp_notify_postauthor() 用于发送通知
- 引入版本:WordPress 3.8.0
原文内容
Filters whether to notify comment authors of their comments on their own posts.
Description
By default, comment authors aren’t notified of their comments on their own posts. This filter allows you to override that.
Parameters
$notifybool-
Whether to notify the post author of their own comment.
Default false. $comment_idstring-
The comment ID as a numeric string.
Source
$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );
Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |