Code Duplication    Length = 10-10 lines in 2 locations

wp-includes/media.php 2 locations

@@ 2259-2268 (lines=10) @@
2256
		}
2257
		$primary = true;
2258
		array_unshift( $default_types, 'src' );
2259
	} else {
2260
		foreach ( $default_types as $ext ) {
2261
			if ( ! empty( $atts[ $ext ] ) ) {
2262
				$type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );
2263
				if ( strtolower( $type['ext'] ) === $ext ) {
2264
					$primary = true;
2265
				}
2266
			}
2267
		}
2268
	}
2269
2270
	if ( ! $primary ) {
2271
		$audios = get_attached_media( 'audio', $post_id );
@@ 2496-2505 (lines=10) @@
2493
2494
		$primary = true;
2495
		array_unshift( $default_types, 'src' );
2496
	} else {
2497
		foreach ( $default_types as $ext ) {
2498
			if ( ! empty( $atts[ $ext ] ) ) {
2499
				$type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() );
2500
				if ( strtolower( $type['ext'] ) === $ext ) {
2501
					$primary = true;
2502
				}
2503
			}
2504
		}
2505
	}
2506
2507
	if ( ! $primary ) {
2508
		$videos = get_attached_media( 'video', $post_id );