When filtering comment notification email recipients, notifications are not sent for author comments
|Reported by:||chipbennett||Owned by:||markjaquith|
Reference support thread:
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'] : '' );
$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.
Change History (18)
comment:2 in reply to: ↑ description DaveAl — 6 weeks ago
comment:7 markjaquith — 2 weeks ago
- Owner set to markjaquith
- Resolution set to fixed
- Status changed from new to closed