Hi Alex,
Thanks for the kind words!
The issue you’re encountering is an inherent part of the core wp_notify_postauthor() function, here:
// The comment was left by the author
if ( $comment->user_id == $post->post_author )
return false;
All the Plugin focuses on is expanding the list of addresses that get emailed when the notification email is sent. In the core function, if the comment is left by the post author, the function returns false, and no email at all is sent.
But, that’s a valid point: non-author recipients would potentially still want to receive notification of comments also left by the post author.
My concern is that I’m also trying to get the core function revised, such that I can simply use a filter, rather than overwriting the entire pluggable function. But, to make this change, I would still have to override the entire function.
Let me put some thought into it, to try to come up with the best approach.
Thanks for the quick reply.
If I comment out that if-then function, will the plugin in send an email to even if the post author comments?
If I comment out that if-then function, will the plugin in send an email to even if the post author comments?
Yes, it should. You may need to comment out the next conditional as well, if you have issues with comment moderation.
okay, I commented both out. Ran a test, but no emails sent.. :-/
I’ll have to look into it some more. Give me a couple days. 🙂
Hey Chip,
Just following up on this issue. Any progress?
Thanks in advance!
Hi,
any progress?
as a quick solution i edited the wp_new_comment function in wp-includes/comment.php
from:
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'] : '' );
to:
if ( get_option('comments_notify') && $commentdata['comment_approved'] )
wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
as the wp_notify_postauthor function doesn’t even get called if the author is the comment poster, so the previously mentioned change by Chip Bennett is not enough..
so to the two commented ifs from Chip Bennetts answer, you can resolve this by changing the if in the core function as shown.
i know its really not a good solution (updates of WordPress will delete that), but i’m not familliar with plugins in wordpress, so i’m not sure whether this function is overridable and if i even should consider overriding it..
I’ve just submitted a bug report for this issue:
http://core.trac.wordpress.org/ticket/25699
Closing as “resolved”, since the issue is really outside of the control of the Plugin.