Ticket #15534: wordpress-email-mod-update2.patch
File wordpress-email-mod-update2.patch, 4.1 KB (added by , 14 years ago) |
---|
-
wp-includes/comment.php
1367 1367 * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false. 1368 1368 * @return bool False on failure or deletion and true on success. 1369 1369 */ 1370 function wp_set_comment_status($comment_id, $comment_status, $wp_error = false ) {1370 function wp_set_comment_status($comment_id, $comment_status, $wp_error = false, $user_id = false) { 1371 1371 global $wpdb; 1372 1372 1373 1373 $status = '0'; … … 1379 1379 case 'approve': 1380 1380 case '1': 1381 1381 $status = '1'; 1382 if( empty( $user_id ) ) 1383 $user_id = get_current_user_id(); 1384 update_comment_meta( $comment_id, 'approve_user', $user_id ); 1382 1385 if ( get_option('comments_notify') ) { 1383 1386 $comment = get_comment($comment_id); 1384 1387 wp_notify_postauthor($comment_id, $comment->comment_type); -
wp-includes/pluggable.php
1010 1010 $comment = get_comment( $comment_id ); 1011 1011 $post = get_post( $comment->comment_post_ID ); 1012 1012 $author = get_userdata( $post->post_author ); 1013 $approve_user = get_comment_meta( $comment_id, 'approve_user', true ); 1014 $approve_userdata = ( !empty( $approve_user ) ) ? get_userdata( $approve_user ) : false; 1013 1015 1014 1016 // The comment was left by the author 1015 1017 if ( $comment->user_id == $post->post_author ) … … 1038 1040 $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n"; 1039 1041 $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; 1040 1042 $notify_message .= sprintf( __('Whois : http://whois.arin.net/rest/ip/%s'), $comment->comment_author_IP ) . "\r\n"; 1043 if( !empty($approve_userdata) ) 1044 $notify_message .= sprintf( __('Approved by : %s'), $approve_userdata->user_nicename ) . "\r\n"; 1041 1045 $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 1042 1046 $notify_message .= __('You can see all comments on this post here: ') . "\r\n"; 1043 1047 /* translators: 1: blog name, 2: post title */ … … 1047 1051 /* translators: 1: website name, 2: author IP, 3: author domain */ 1048 1052 $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 1049 1053 $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; 1054 if( !empty($approve_userdata) ) 1055 $notify_message .= sprintf( __('Approved by : %s'), $approve_userdata->user_nicename ) . "\r\n"; 1050 1056 $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 1051 1057 $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n"; 1052 1058 /* translators: 1: blog name, 2: post title */ … … 1056 1062 /* translators: 1: comment author, 2: author IP, 3: author domain */ 1057 1063 $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 1058 1064 $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n"; 1065 if( !empty($approve_userdata) ) 1066 $notify_message .= sprintf( __('Approved by : %s'), $approve_userdata->user_nicename ) . "\r\n"; 1059 1067 $notify_message .= __('Excerpt: ') . "\r\n" . sprintf('[...] %s [...]', $comment->comment_content ) . "\r\n\r\n"; 1060 1068 $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n"; 1061 1069 /* translators: 1: blog name, 2: post title */ … … 1069 1077 $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n"; 1070 1078 $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; 1071 1079 1080 if( !empty($approve_userdata) ) 1081 $subject .= sprintf( __(', approved by %s'), $approve_userdata->user_nicename ); 1072 1082 $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); 1073 1083 1074 1084 if ( '' == $comment->comment_author ) {