Make WordPress Core


Ignore:
Timestamp:
12/04/2006 02:25:21 PM (18 years ago)
Author:
markjaquith
Message:

change post_parent on orphaned attachments. props ryanscheuermann. fixes #2681

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r4561 r4601  
    410410    if ( 'page' == $post->post_type )
    411411        $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'page'");
     412
     413    $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'attachment'");
    412414
    413415    $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid");
Note: See TracChangeset for help on using the changeset viewer.