WordPress.org

Make WordPress Core

Changeset 4602


Ignore:
Timestamp:
12/04/06 14:31:09 (7 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/functions-post.php

    r4533 r4602  
    552552    if ( 'static' == $post->post_status ) 
    553553        $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_status = 'static'"); 
     554 
     555    $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_status = 'attachment'"); 
    554556 
    555557    $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid"); 
Note: See TracChangeset for help on using the changeset viewer.