钩子文档

notify_post_author

💡 云策文档标注

概述

notify_post_author 是一个 WordPress 过滤器,用于控制是否向文章作者发送新评论通知邮件,可以覆盖站点设置。

关键要点

  • 过滤器名称:notify_post_author
  • 参数:$maybe_notify(布尔值,表示是否通知作者)和 $comment_id(整数,评论 ID)
  • 用途:在 wp_new_comment_notify_postauthor() 函数中调用,影响新评论通知的发送行为
  • 引入版本:WordPress 4.4.0

📄 原文内容

Filters whether to send the post author new comment notification emails, overriding the site setting.

Parameters

$maybe_notifybool
Whether to notify the post author about the new comment.
$comment_idint
The ID of the comment for the notification.

Source

$maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_id );

Changelog

Version Description
4.4.0 Introduced.