Changeset 16223 for trunk/wp-includes/pluggable.php
- Timestamp:
- 11/06/2010 03:20:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r16208 r16223 1006 1006 $moderating_uid = (int) $user->id; 1007 1007 1008 1009 1008 if ( $comment->user_id == $post->post_author ) return false; // The comment was left by the author. 1010 1009 1011 1010 if ( $user->user_id == $moderating_uid ) return false; // The author moderated a comment on his own post 1012 1011 … … 1100 1099 global $wpdb; 1101 1100 1102 if ( get_option( "moderation_notify" ) == 0)1101 if ( 0 == get_option( 'moderation_notify' ) ) 1103 1102 return true; 1104 1103 1105 $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID=%d LIMIT 1", $comment_id)); 1106 $post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID=%d LIMIT 1", $comment->comment_post_ID)); 1104 $comment = get_comment($comment_id); 1105 $post = get_post($comment->comment_post_ID); 1106 $user = get_userdata( $post->post_author ); 1107 // Send to the administation and to the post author if the author can modify the comment. 1108 $email_to = array( get_option('admin_email') ); 1109 if ( user_can($user->ID, 'edit_comment', $comment_id) && !empty($user->user_email) && ( get_option('admin_email') != $user->user_email) ) 1110 $email_to[] = $user->user_email; 1107 1111 1108 1112 $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); … … 1152 1156 1153 1157 $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title ); 1154 $admin_email = get_option('admin_email');1155 1158 $message_headers = ''; 1156 1159 … … 1159 1162 $message_headers = apply_filters('comment_moderation_headers', $message_headers); 1160 1163 1161 @wp_mail($admin_email, $subject, $notify_message, $message_headers); 1164 foreach ( $email_to as $email ) 1165 @wp_mail($email, $subject, $notify_message, $message_headers); 1162 1166 1163 1167 return true;
Note: See TracChangeset
for help on using the changeset viewer.