Ticket #2681: orphan_attachments2.patch
| File orphan_attachments2.patch, 0.7 kB (added by ryanscheuermann, 3 years ago) |
|---|
-
wp-includes/functions-post.php
old new 579 579 if ( 'page' == $post->post_type ) 580 580 $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'page'"); 581 581 582 $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'attachment'"); 583 582 584 $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid"); 583 585 584 586 $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID = $postid");
