Ticket #761: 761.2.diff
| File 761.2.diff, 2.6 KB (added by , 14 years ago) |
|---|
-
wp-includes/comment.php
1371 1371 if ( '0' == $commentdata['comment_approved'] ) 1372 1372 wp_notify_moderator($comment_ID); 1373 1373 1374 $post = get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 1375 1376 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1377 wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 1374 wp_notify_postauthor( $comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' ); 1378 1375 } 1379 1376 1380 1377 return $comment_ID; … … 1406 1403 case 'approve': 1407 1404 case '1': 1408 1405 $status = '1'; 1409 if ( get_option('comments_notify') ) {1410 $comment = get_comment($comment_id);1411 wp_notify_postauthor($comment_id, $comment->comment_type);1412 }1413 1406 break; 1414 1407 case 'spam': 1415 1408 $status = 'spam'; … … 1434 1427 1435 1428 $comment = get_comment($comment_id); 1436 1429 1430 if ( '1' == $status ) 1431 wp_notify_postauthor( $comment_id, $comment->comment_type ); 1432 1437 1433 do_action('wp_set_comment_status', $comment_id, $comment_status); 1438 1434 wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment); 1439 1435 -
wp-includes/pluggable.php
980 980 * Notify an author of a comment/trackback/pingback to one of their posts. 981 981 * 982 982 * @since 1.0.0 983 * @uses apply_filters() Calls 'wp_notify_postauthor' hook on get_option('comments_notify') and comment_approved value before processing 983 984 * 984 985 * @param int $comment_id Comment ID 985 986 * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback' … … 1002 1003 if ( '' == $author->user_email ) 1003 1004 return false; 1004 1005 1006 // Possibly notify if get_option( 'comments_notify' ) is true, comment is 1007 // approved, and filter 'wp_notify_postauthor' doesn't override those values 1008 $maybe_notify = get_option( 'comments_notify' ) && ( '1' == $comment->comment_approved ); 1009 $maybe_notify = apply_filters( 'wp_notify_postauthor', $maybe_notify, $comment ); 1010 if ( ! $maybe_notify ) 1011 return false; 1012 1005 1013 $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); 1006 1014 1007 1015 // The blogname option is escaped with esc_html on the way into the database in sanitize_option
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)