diff --git a/wp-includes/post.php b/wp-includes/post.php index 0f75bf537e..b6ca7c24d3 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3236,7 +3236,7 @@ function wp_delete_post( $postid = 0, $force_delete = false ) { wp_defer_comment_counting( true ); - $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ) ); + $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $postid ) ); foreach ( $comment_ids as $comment_id ) { wp_delete_comment( $comment_id, true ); } @@ -6194,7 +6194,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) { wp_defer_comment_counting( true ); - $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) ); + $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 ) ); foreach ( $comment_ids as $comment_id ) { wp_delete_comment( $comment_id, true ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2c8c21e10d..acb681e1d8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52014'; +$wp_version = '5.9-alpha-52015'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.