钩子文档

comment_notification_recipients

💡 云策文档标注

概述

comment_notification_recipients 是一个 WordPress 过滤器,用于修改接收评论通知的电子邮件地址列表。默认情况下,仅通知文章作者,此过滤器允许添加其他收件人。

关键要点

  • 过滤器名称:comment_notification_recipients
  • 参数:$emails(电子邮件地址数组)和 $comment_id(评论 ID 字符串)
  • 默认行为:仅通知文章作者
  • 用途:扩展评论通知的收件人范围
  • 相关函数:wp_notify_postauthor()
  • 引入版本:WordPress 3.7.0

📄 原文内容

Filters the list of email addresses to receive a comment notification.

Description

By default, only post authors are notified of comments. This filter allows others to be added.

Parameters

$emailsstring[]
An array of email addresses to receive a comment notification.
$comment_idstring
The comment ID as a numeric string.

Source

$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );

Changelog

Version Description
3.7.0 Introduced.