Ticket #12766: commentmeta.patch
| File commentmeta.patch, 1.9 KB (added by briancolinger, 3 years ago) |
|---|
-
Sites/wordpress-trunk/wp-includes/post.php
1653 1653 $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid )); 1654 1654 if ( ! empty($comment_ids) ) { 1655 1655 do_action( 'delete_comment', $comment_ids ); 1656 $in_comment_ids = "'" . implode("', '", $comment_ids) . "'"; 1657 $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_ID IN($in_comment_ids)" ); 1656 foreach ( $comment_ids as $comment_id ) { 1657 $force_delete_comment = true; 1658 wp_delete_comment( $comment_id, $force_delete_comment ); 1659 } 1658 1660 do_action( 'deleted_comment', $comment_ids ); 1659 1661 } 1660 1662 -
Sites/wordpress-trunk/wp-includes/comment.php
869 869 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object 870 870 * 871 871 * @param int $comment_id Comment ID 872 * @param bool $force_delete Whether to bypass trash and force deletion 872 873 * @return bool False if delete comment query failure, true on success. 873 874 */ 874 function wp_delete_comment($comment_id ) {875 function wp_delete_comment($comment_id, $force_delete = false) { 875 876 global $wpdb; 876 877 if (!$comment = get_comment($comment_id)) 877 878 return false; 878 879 879 if ( wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0)880 if ( !$force_delete && wp_get_comment_status( $comment_id ) != 'trash' && wp_get_comment_status( $comment_id ) != 'spam' && EMPTY_TRASH_DAYS > 0 ) 880 881 return wp_trash_comment($comment_id); 881 882 882 883 do_action('delete_comment', $comment_id);
