Ticket #44179: 44179.diff
File 44179.diff, 1.3 KB (added by , 5 years ago) |
---|
-
src/wp-includes/comment.php
3444 3444 $messages = array(); 3445 3445 3446 3446 foreach ( (array) $comments as $comment ) { 3447 $comment_id = (int) $comment->comment_ID; 3448 3447 3449 $anonymized_comment = array(); 3450 $anonymized_comment['comment_ID'] = $comment_id; 3448 3451 $anonymized_comment['comment_agent'] = ''; 3449 3452 $anonymized_comment['comment_author'] = $anon_author; 3450 3453 $anonymized_comment['comment_author_email'] = wp_privacy_anonymize_data( 'email', $comment->comment_author_email ); … … 3452 3455 $anonymized_comment['comment_author_url'] = wp_privacy_anonymize_data( 'url', $comment->comment_author_url ); 3453 3456 $anonymized_comment['user_id'] = 0; 3454 3457 3455 $comment_id = (int) $comment->comment_ID;3456 3457 3458 /** 3458 3459 * Filters whether to anonymize the comment. 3459 3460 * … … 3479 3480 continue; 3480 3481 } 3481 3482 3482 $args = array( 3483 'comment_ID' => $comment_id, 3484 ); 3483 $updated = wp_update_comment( $anonymized_comment ); 3485 3484 3486 $updated = $wpdb->update( $wpdb->comments, $anonymized_comment, $args ); 3487 3488 if ( $updated ) { 3485 if ( 1 === $updated ) { 3489 3486 $items_removed = true; 3490 3487 clean_comment_cache( $comment_id ); 3491 3488 } else {