[wp-trac] [WordPress Trac] #761: Add hook to conditionally disable comment notifications
WordPress Trac
noreply at wordpress.org
Wed Oct 21 18:34:08 UTC 2015
#761: Add hook to conditionally disable comment notifications
------------------------------------+---------------------------
Reporter: coffee2code | Owner: DrewAPicture
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.4
Component: Comments | Version: 1.2.2
Severity: normal | Resolution: fixed
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+---------------------------
Changes (by DrewAPicture):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"35339"]:
{{{
#!CommitTicketReference repository="" revision="35339"
Comments: Introduce two new filters, `notify_moderator` and
`notify_post_author`, both of which make it possible to selectively
override site notification email settings for new comments.
The `notify_moderator` filter makes it possible to override the value for
the `moderation_notify` option, which controls whether to send new comment
emails to "site moderators", that is to say, the owner of the admin email
for the site and the post author if they have the ability to modify the
comment.
The `notify_post_author` filter likewise makes it possible to override the
value for the `comments_notify` option, which controls whether to send new
comment emails to the post author. If the post author is the comment
author, default behavior is not to send the notification. Note: enabling
or disabling notifications via this hook could also affect other
recipients added via the 'comment_notification_recipients' filter in
`wp_notify_postauthor()`, if hooked.
Passing a falsey value to either of the new filters will prevent
notifications from being sent, regardless of their corresponding option
values.
Adds tests.
Props coffee2code, adamsilverstein, DrewAPicture.
Fixes #761.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/761#comment:33>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list