@@ 59-65 (lines=7) @@ | ||
56 | } |
|
57 | ||
58 | $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ); |
|
59 | if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) { |
|
60 | if ( wp_attachment_is( 'audio', $post ) ) { |
|
61 | $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' ); |
|
62 | } elseif ( wp_attachment_is( 'video', $post ) ) { |
|
63 | $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' ); |
|
64 | } |
|
65 | } |
|
66 | ||
67 | if ( $thumbnail_support ) { |
|
68 | add_thickbox(); |
@@ 3466-3472 (lines=7) @@ | ||
3463 | ); |
|
3464 | ||
3465 | $thumbnail_support = current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' ); |
|
3466 | if ( ! $thumbnail_support && 'attachment' === $post->post_type && $post->post_mime_type ) { |
|
3467 | if ( wp_attachment_is( 'audio', $post ) ) { |
|
3468 | $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' ); |
|
3469 | } elseif ( wp_attachment_is( 'video', $post ) ) { |
|
3470 | $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' ); |
|
3471 | } |
|
3472 | } |
|
3473 | ||
3474 | if ( $thumbnail_support ) { |
|
3475 | $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true ); |
@@ 3389-3395 (lines=7) @@ | ||
3386 | // Set or remove featured image. |
|
3387 | if ( isset( $postarr['_thumbnail_id'] ) ) { |
|
3388 | $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type; |
|
3389 | if ( ! $thumbnail_support && 'attachment' === $post_type && $post_mime_type ) { |
|
3390 | if ( wp_attachment_is( 'audio', $post_ID ) ) { |
|
3391 | $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' ); |
|
3392 | } elseif ( wp_attachment_is( 'video', $post_ID ) ) { |
|
3393 | $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' ); |
|
3394 | } |
|
3395 | } |
|
3396 | ||
3397 | if ( $thumbnail_support ) { |
|
3398 | $thumbnail_id = intval( $postarr['_thumbnail_id'] ); |