Ticket #2681: orphan_attachments.patch
| File orphan_attachments.patch, 624 bytes (added by ryanscheuermann, 7 years ago) |
|---|
-
functions-post.php
572 572 if ( 'page' == $post->post_type ) 573 573 $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'page'"); 574 574 575 $wpdb->query("UPDATE $wpdb->posts SET post_parent = 0 WHERE post_parent = $postid AND post_type = 'attachment'"); 576 575 577 $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid"); 576 578 577 579 $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID = $postid");
