Code Duplication    Length = 7-7 lines in 3 locations

wp-admin/edit-form-advanced.php 1 location

@@ 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();

wp-includes/post.php 1 location

@@ 3288-3294 (lines=7) @@
3285
	// Set or remove featured image.
3286
	if ( isset( $postarr['_thumbnail_id'] ) ) {
3287
		$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type;
3288
		if ( ! $thumbnail_support && 'attachment' === $post_type && $post_mime_type ) {
3289
			if ( wp_attachment_is( 'audio', $post_ID ) ) {
3290
				$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
3291
			} elseif ( wp_attachment_is( 'video', $post_ID ) ) {
3292
				$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
3293
			}
3294
		}
3295
3296
		if ( $thumbnail_support ) {
3297
			$thumbnail_id = intval( $postarr['_thumbnail_id'] );

wp-includes/media.php 1 location

@@ 3351-3357 (lines=7) @@
3348
		);
3349
3350
		$thumbnail_support = current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' );
3351
		if ( ! $thumbnail_support && 'attachment' === $post->post_type && $post->post_mime_type ) {
3352
			if ( wp_attachment_is( 'audio', $post ) ) {
3353
				$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
3354
			} elseif ( wp_attachment_is( 'video', $post ) ) {
3355
				$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
3356
			}
3357
		}
3358
3359
		if ( $thumbnail_support ) {
3360
			$featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true );