• Resolved alex.morrison

    (@alexmorrison)


    Hey Chip,

    Great plugin. I’m running to one issue however. My scenario: I’ve got 3 author users on the site, and that’s all. It’s a closed, private site for the authors to write and communicate to each other.

    The goal is for everyone to receive an email regardless of who comments on what post. Your plugin works for me except for when the post author comments on his own post… no one receives a notification then.

    – Everyone has the “Comment Email Notification” option checked in their user profile.
    – Every user role is checked off in the Discussion menu as well as the first option in the Misc options.

    Thanks in advance!

    https://www.ads-software.com/extend/plugins/cbnet-multi-author-comment-notification/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Chip Bennett

    (@chipbennett)

    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.

    Thread Starter alex.morrison

    (@alexmorrison)

    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?

    Plugin Author Chip Bennett

    (@chipbennett)

    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.

    Thread Starter alex.morrison

    (@alexmorrison)

    okay, I commented both out. Ran a test, but no emails sent.. :-/

    Plugin Author Chip Bennett

    (@chipbennett)

    I’ll have to look into it some more. Give me a couple days. ??

    Thread Starter alex.morrison

    (@alexmorrison)

    No problem. Thanks!!

    Thread Starter alex.morrison

    (@alexmorrison)

    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..

    Plugin Author Chip Bennett

    (@chipbennett)

    I’ve just submitted a bug report for this issue:
    https://core.trac.www.ads-software.com/ticket/25699

    Closing as “resolved”, since the issue is really outside of the control of the Plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘no notifications when post author comments’ is closed to new replies.