钩子文档

notify_moderator

💡 云策文档标注

概述

notify_moderator 是一个 WordPress 过滤器钩子,用于控制是否向站点管理员发送邮件通知,可以覆盖站点设置。

关键要点

  • 这是一个过滤器钩子,允许开发者修改是否发送评论审核通知给管理员。
  • 参数包括 $maybe_notify(布尔值,表示是否通知)和 $comment_id(整数,评论 ID)。
  • 在 wp_new_comment_notify_moderator() 和 wp_notify_moderator() 函数中使用,用于新评论审核通知。
  • 自 WordPress 4.4.0 版本引入。

📄 原文内容

Filters whether to send the site moderator email notifications, overriding the site setting.

Parameters

$maybe_notifybool
Whether to notify blog moderator.
$comment_idint
The ID of the comment for the notification.

Source

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

Changelog

Version Description
4.4.0 Introduced.