[wp-trac] [WordPress Trac] #25699: When filtering comment notification email recipients, notifications are not sent for author comments

WordPress Trac noreply at wordpress.org
Sun Nov 24 14:54:30 UTC 2013


#25699: When filtering comment notification email recipients, notifications are not
sent for author comments
--------------------------+------------------
 Reporter:  chipbennett   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.8
Component:  Comments      |     Version:  3.7
 Severity:  minor         |  Resolution:
 Keywords:                |
--------------------------+------------------
Changes (by ethitter):

 * cc: erick@… (added)


Comment:

 [attachment:25699.patch] allows `wp_notify_postauthor()` to send an email
 for a comment by the post author. The logic to check if an email should be
 sent is moved entirely into `wp_notify_postauthor()`, rather than checking
 in both `wp_new_comment()` and `wp_notify_postauthor()` as was done
 previously.

 To do so, I moved the `comment_notification_recipients` filter towards the
 top of `wp_notify_postauthor()`, so we can bail as early as possible if
 only the post author would be notified, or no recipients are set. The
 recipients array is still subjected to various checks that previously
 caused the function to return `false`: the author of the comment is the
 post author, the post author moderated his/her own comment, or the post
 author can no longer read the post.

 As noted above, the post author still isn't notified for his/her own
 comment, but any additional addresses will receive the notifications for
 post author's comments. New filters allow the post author to receive a
 notification if desired; while these filters can bypass the capabilities
 check, the filter would already allow a user to do so, so the permissions
 burden has always fallen to the individuals using the provided filters.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25699#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list