Code Duplication    Length = 14-14 lines in 2 locations

src/wp-includes/media.php 2 locations

@@ 2254-2267 (lines=14) @@
2251
		}
2252
	}
2253
2254
	if ( ! $primary ) {
2255
		$audios = get_attached_media( 'audio', $post_id );
2256
		if ( empty( $audios ) ) {
2257
			return;
2258
		}
2259
2260
		$audio = reset( $audios );
2261
		$atts['src'] = wp_get_attachment_url( $audio->ID );
2262
		if ( empty( $atts['src'] ) ) {
2263
			return;
2264
		}
2265
2266
		array_unshift( $default_types, 'src' );
2267
	}
2268
2269
	/**
2270
	 * Filters the media library used for the audio shortcode.
@@ 2491-2504 (lines=14) @@
2488
		}
2489
	}
2490
2491
	if ( ! $primary ) {
2492
		$videos = get_attached_media( 'video', $post_id );
2493
		if ( empty( $videos ) ) {
2494
			return;
2495
		}
2496
2497
		$video = reset( $videos );
2498
		$atts['src'] = wp_get_attachment_url( $video->ID );
2499
		if ( empty( $atts['src'] ) ) {
2500
			return;
2501
		}
2502
2503
		array_unshift( $default_types, 'src' );
2504
	}
2505
2506
	/**
2507
	 * Filters the media library used for the video shortcode.