diff --git wp-includes/post.php wp-includes/post.php
index 2be10a1db6..5b39914377 100644
|
|
function wp_delete_attachment( $post_id, $force_delete = false ) { |
5614 | 5614 | // Delete all for any posts. |
5615 | 5615 | delete_metadata( 'post', null, '_thumbnail_id', $post_id, true ); |
5616 | 5616 | |
| 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 | |
5617 | 5623 | wp_defer_comment_counting( true ); |
5618 | 5624 | |
5619 | 5625 | $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) ); |