Ticket #16995: 16995.diff
| File 16995.diff, 1.9 KB (added by solarissmoke, 2 years ago) |
|---|
-
wp-includes/comment.php
1340 1340 if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching 1341 1341 if ( '0' == $commentdata['comment_approved'] ) 1342 1342 wp_notify_moderator($comment_ID); 1343 1344 $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 1345 1346 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1343 else 1347 1344 wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 1348 1345 } 1349 1346 … … 1379 1376 case 'approve': 1380 1377 case '1': 1381 1378 $status = '1'; 1382 if ( get_option('comments_notify') ) { 1383 $comment = get_comment($comment_id); 1384 wp_notify_postauthor($comment_id, $comment->comment_type); 1385 } 1379 $comment = get_comment($comment_id); 1380 wp_notify_postauthor($comment_id, $comment->comment_type); 1386 1381 break; 1387 1382 case 'spam': 1388 1383 $status = 'spam'; -
wp-includes/pluggable.php
1004 1004 * 1005 1005 * @param int $comment_id Comment ID 1006 1006 * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback' 1007 * @return bool False if user email does not exist. True on completion.1007 * @return bool False if email was not sent. True on completion. 1008 1008 */ 1009 1009 function wp_notify_postauthor( $comment_id, $comment_type = '' ) { 1010 if( 0 == get_option('comments_notify') ) 1011 return false; 1012 1010 1013 $comment = get_comment( $comment_id ); 1011 1014 $post = get_post( $comment->comment_post_ID ); 1012 1015 $author = get_userdata( $post->post_author );