Ticket #17862: 17862.diff
File 17862.diff, 2.2 KB (added by , 14 years ago) |
---|
-
wp-includes/comment.php
1355 1355 $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 1356 1356 1357 1357 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) 1358 wp_notify_postauthor( $comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '');1358 wp_notify_postauthor( $comment_ID ); 1359 1359 } 1360 1360 1361 1361 return $comment_ID; … … 1391 1391 case '1': 1392 1392 $status = '1'; 1393 1393 if ( get_option('comments_notify') ) { 1394 $comment = get_comment($comment_id); 1395 wp_notify_postauthor($comment_id, $comment->comment_type); 1394 wp_notify_postauthor( $comment_id ); 1396 1395 } 1397 1396 break; 1398 1397 case 'spam': -
wp-includes/pluggable.php
1040 1040 * @since 1.0.0 1041 1041 * 1042 1042 * @param int $comment_id Comment ID 1043 * @param string $ comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback'1043 * @param string $deprecated Not used 1044 1044 * @return bool False if user email does not exist. True on completion. 1045 1045 */ 1046 function wp_notify_postauthor( $comment_id, $comment_type = '' ) { 1046 function wp_notify_postauthor( $comment_id, $deprecated = null ) { 1047 if ( null !== $deprecated ) 1048 _deprecated_argument( __FUNCTION__, '3.3' ); 1049 1047 1050 $comment = get_comment( $comment_id ); 1048 1051 $post = get_post( $comment->comment_post_ID ); 1049 1052 $author = get_userdata( $post->post_author ); … … 1066 1069 // we want to reverse this for the plain text arena of emails. 1067 1070 $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); 1068 1071 1069 if ( empty( $comment_type ) ) $comment_type ='comment';1072 $comment_type = $comment->comment_type ? $comment->comment_type : 'comment'; 1070 1073 1071 1074 if ('comment' == $comment_type) { 1072 1075 $notify_message = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";