Make WordPress Core

Ticket #49086: 49086.diff

File 49086.diff, 641 bytes (added by henry.wright, 5 years ago)
  • wp-includes/post.php

    diff --git wp-includes/post.php wp-includes/post.php
    index 2be10a1db6..5b39914377 100644
    function wp_delete_attachment( $post_id, $force_delete = false ) { 
    56145614        // Delete all for any posts.
    56155615        delete_metadata( 'post', null, '_thumbnail_id', $post_id, true );
    56165616
     5617        $site_icon_id = get_option( 'site_icon' );
     5618
     5619        if ( $site_icon_id && $post_id == $site_icon_id ) {
     5620                delete_option( 'site_icon' );
     5621        }
     5622
    56175623        wp_defer_comment_counting( true );
    56185624
    56195625        $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );