WordPress.org

Make WordPress Core

Ticket #10928: referential_integrity.diff

File referential_integrity.diff, 728 bytes (added by scribu, 6 years ago)
  • post.php

     
    27102710        /** @todo Delete for pluggable post taxonomies too */ 
    27112711        wp_delete_object_term_relationships($post_id, array('category', 'post_tag')); 
    27122712 
     2713        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND meta_value = %d", $post_id )); 
     2714 
    27132715        $commentids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id )); 
    27142716        do_action( 'delete_comment', $commentids ); 
    27152717        $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_ID IN(%s)", implode( ',', $commentids ) ));