Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #25699, comment 2


Ignore:
Timestamp:
10/27/2013 08:11:49 AM (10 years ago)
Author:
DaveAl
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25699, comment 2

    initial v1  
    23231. In wp_new_comment(), a check for multiple recipients needs to be added to the if condition, something along the lines of:
    2424{{{
     25$recipients = 0;
    2526$recipients = count( apply_filters( 'comment_notification_recipients', $recipients, $comment_id ) );
    2627...
    2728...
    28 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] || $recipients > 1 ) )
     29if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] || $recipients > 0 ) )
    2930        wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
    3031}}}
     
    32332. A similar check would need to be added to wp_notify_postauthor in pluggable.php to prevent it from returning in the case of multiple recipients:
    3334{{{
     35$recipients = 0;
    3436$recipients = count( apply_filters( 'comment_notification_recipients', $recipients, $comment_id ) );
    3537...
    3638...
    3739    // The comment was left by the author
    38     if ( $comment->user_id == $post->post_author && $recipients <= 1 )
     40    if ( $comment->user_id == $post->post_author && $recipients == 0 )
    3941        return false;
    4042}}}