Make WordPress Core

Changeset 12054


Ignore:
Timestamp:
10/18/2009 01:58:44 PM (15 years ago)
Author:
markjaquith
Message:

Delete post thumbnail relationships for deleted attachments. props scribu. see #10928

File:
1 edited

Legend:

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

    r12047 r12054  
    27102710    /** @todo Delete for pluggable post taxonomies too */
    27112711    wp_delete_object_term_relationships($post_id, array('category', 'post_tag'));
     2712
     2713    $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND meta_value = %d", $post_id ));
    27122714
    27132715    $commentids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ));
Note: See TracChangeset for help on using the changeset viewer.