Delete child post and attachment links to parent post
There’s no way of doing this without “listening” for the responsible database query and altering it with the query filter, thanks to this line in wp_delete_post(): // Point all attachments to this post up one level $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( ‘post_type’ => ‘attachment’ ) ); The following will override the query and set … Read more