diff --git wp-includes/post.php wp-includes/post.php
index 9cf0c16..b0ca5ae 100644
|
|
function wp_delete_attachment( $post_id, $force_delete = false ) { |
4716 | 4716 | */ |
4717 | 4717 | do_action( 'delete_attachment', $post_id ); |
4718 | 4718 | |
4719 | | wp_delete_object_term_relationships($post_id, array('category', 'post_tag')); |
4720 | | wp_delete_object_term_relationships($post_id, get_object_taxonomies($post->post_type)); |
| 4719 | if ( ( ! empty( $attachment_taxonomies = get_object_taxonomies( $post->post_type ) ) ) ) { |
| 4720 | wp_delete_object_term_relationships( $post_id, $attachment_taxonomies ); |
| 4721 | } |
4721 | 4722 | |
4722 | 4723 | // Delete all for any posts. |
4723 | 4724 | delete_metadata( 'post', null, '_thumbnail_id', $post_id, true ); |