Code Duplication    Length = 10-10 lines in 2 locations

src/wp-includes/media.php 2 locations

@@ 2273-2282 (lines=10) @@
2270
		}
2271
		$primary = true;
2272
		array_unshift( $default_types, 'src' );
2273
	} else {
2274
		foreach ( $default_types as $ext ) {
2275
			if ( ! empty( $atts[ $ext ] ) ) {
2276
				$type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );
2277
				if ( strtolower( $type['ext'] ) === $ext ) {
2278
					$primary = true;
2279
				}
2280
			}
2281
		}
2282
	}
2283
2284
	if ( ! $primary ) {
2285
		$audios = get_attached_media( 'audio', $post_id );
@@ 2510-2519 (lines=10) @@
2507
2508
		$primary = true;
2509
		array_unshift( $default_types, 'src' );
2510
	} else {
2511
		foreach ( $default_types as $ext ) {
2512
			if ( ! empty( $atts[ $ext ] ) ) {
2513
				$type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );
2514
				if ( strtolower( $type['ext'] ) === $ext ) {
2515
					$primary = true;
2516
				}
2517
			}
2518
		}
2519
	}
2520
2521
	if ( ! $primary ) {
2522
		$videos = get_attached_media( 'video', $post_id );