| 3263 | | if ( isset( $postarr['_thumbnail_id'] ) && ( post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type ) ) { |
| 3264 | | $thumbnail_id = intval( $postarr['_thumbnail_id'] ); |
| 3265 | | if ( -1 === $thumbnail_id ) { |
| 3266 | | delete_post_thumbnail( $post_ID ); |
| 3267 | | } else { |
| 3268 | | set_post_thumbnail( $post_ID, $thumbnail_id ); |
| | 3263 | if ( isset( $postarr['_thumbnail_id'] ) ) { |
| | 3264 | $thumbnail_support = post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type; |
| | 3265 | if ( ! $thumbnail_support && 'attachment' === $post_type && $post_mime_type ) { |
| | 3266 | if ( wp_attachment_is( 'audio', $post_ID ) ) { |
| | 3267 | $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ); |
| | 3268 | } elseif ( wp_attachment_is( 'video', $post_ID ) ) { |
| | 3269 | $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ); |
| | 3270 | } |