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

WordPress Trac noreply at wordpress.org
Fri Oct 25 15:39:59 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:  Awaiting Review
Component:  Comments      |    Version:  3.7
 Severity:  minor         |   Keywords:
--------------------------+-----------------------------
 Reference support thread:
 http://wordpress.org/support/topic/no-notifications-when-post-author-
 comments?replies=9

 Core filters `'comment_notification_recipients'` for
 `wp_notify_postauthor()` and `'comment_moderation_recipients'` for
 `wp_notify_moderator()` were added in WordPress 3.7. When
 `'comment_notification_recipients'` is filtered to add additional
 recipients, no email notification is sent for post-author comments.

 This issue occurs because of this conditional check in the
 `wp_new_comment()` function in `wp-includes/comment.php`:

 {{{
 if ( get_option('comments_notify') && $commentdata['comment_approved'] &&
 ( ! isset( $commentdata['user_id'] ) || $post->post_author !=
 $commentdata['user_id'] ) )
         wp_notify_postauthor($comment_ID, isset(
 $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
 }}}

 Specifically:
 {{{
 $post->post_author != $commentdata['user_id']
 }}}

 Obviously, this conditional is in place for good reason (post authors
 don't need to receive notification for their own comments); but it
 interferes with email notification for multiple recipients.

 I'd be happy to patch, but I'm not sure of the most elegant solution.

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


More information about the wp-trac mailing list