diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index e8e6732dc7..6f68462d0d 100644
a
|
b
|
function wp_delete_post( $postid = 0, $force_delete = false ) { |
3014 | 3014 | |
3015 | 3015 | wp_defer_comment_counting( true ); |
3016 | 3016 | |
3017 | | $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ) ); |
| 3017 | $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $postid ) ); |
3018 | 3018 | foreach ( $comment_ids as $comment_id ) { |
3019 | 3019 | wp_delete_comment( $comment_id, true ); |
3020 | 3020 | } |
… |
… |
function wp_delete_attachment( $post_id, $force_delete = false ) { |
5662 | 5662 | |
5663 | 5663 | wp_defer_comment_counting( true ); |
5664 | 5664 | |
5665 | | $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) ); |
| 5665 | $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $post_id ) ); |
5666 | 5666 | foreach ( $comment_ids as $comment_id ) { |
5667 | 5667 | wp_delete_comment( $comment_id, true ); |
5668 | 5668 | } |