Code Duplication    Length = 8-9 lines in 2 locations

modules/shortcodes/spotify.php 1 location

@@ 32-40 (lines=9) @@
29
 */
30
function jetpack_spotify_shortcode( $atts = array(), $content = '' ) {
31
32
	if ( ! empty( $content ) ) {
33
		$id = $content;
34
	} elseif ( ! empty( $atts['id'] ) ) {
35
		$id = $atts['id'];
36
	} elseif ( ! empty( $atts[0] ) ) {
37
		$id = $atts[0];
38
	} else {
39
		return '<!-- Missing Spotify ID -->';
40
	}
41
42
	if ( empty( $atts['width'] ) ) {
43
		$atts['width'] = 300;

modules/shortcodes/getty.php 1 location

@@ 201-208 (lines=8) @@
198
 */
199
function jetpack_getty_shortcode( $atts, $content = '' ) {
200
201
	if ( ! empty( $content ) ) {
202
		$src = $content;
203
	} elseif ( ! empty( $atts['src'] ) ) {
204
		$src = $atts['src'];
205
	} elseif ( ! empty( $atts[0] ) ) {
206
		$src = $atts[0];
207
	} else {
208
		return '<!-- Missing Getty Source ID -->';
209
	}
210
211
	$src = preg_replace( '/^([\da-z-]+(,[\da-z-]+)*).*$/', '$1', $src );