Code Duplication    Length = 9-22 lines in 3 locations

projects/plugins/jetpack/modules/shortcodes/hulu.php 1 location

@@ 22-30 (lines=9) @@
19
20
add_shortcode( 'hulu', 'jetpack_hulu_shortcode' );
21
22
if (
23
	! is_admin()
24
	/** This filter is documented in modules/shortcodes/youtube.php */
25
	&& apply_filters( 'jetpack_comments_allow_oembed', true )
26
	// No need for this on WordPress.com, this is done for multiple shortcodes at a time there.
27
	&& ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM )
28
) {
29
	add_filter( 'comment_text', 'jetpack_hulu_link', 1 );
30
}
31
32
/**
33
 * Return a Hulu video ID from a given set to attributes.

projects/plugins/jetpack/modules/shortcodes/vimeo.php 1 location

@@ 391-404 (lines=14) @@
388
	return $matches[0];
389
}
390
391
if (
392
	! is_admin()
393
	/** This filter is documented in modules/shortcodes/youtube.php */
394
	&& apply_filters( 'jetpack_comments_allow_oembed', true )
395
	// No need for this on WordPress.com, this is done for multiple shortcodes at a time there.
396
	&& ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM )
397
) {
398
	/*
399
	 * We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway,
400
	 * so the iframe gets filtered out.
401
	 * Higher priority because we need it before auto-link and autop get to it
402
	 */
403
	add_filter( 'comment_text', 'vimeo_link', 1 );
404
}
405

projects/plugins/jetpack/modules/shortcodes/youtube.php 1 location

@@ 543-564 (lines=22) @@
540
}
541
add_action( 'init', 'wpcom_youtube_embed_crazy_url_init' );
542
543
if (
544
	! is_admin()
545
	/**
546
	 * Allow oEmbeds in Jetpack's Comment form.
547
	 *
548
	 * @module shortcodes
549
	 *
550
	 * @since 2.8.0
551
	 *
552
	 * @param int $allow_oembed Option to automatically embed all plain text URLs.
553
	 */
554
	&& apply_filters( 'jetpack_comments_allow_oembed', true )
555
	// No need for this on WordPress.com, this is done for multiple shortcodes at a time there.
556
	&& ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM )
557
) {
558
	/*
559
	 * We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway,
560
	 * so the iframe gets filtered out.
561
	 * Higher priority because we need it before auto-link and autop get to it.
562
	 */
563
	add_filter( 'comment_text', 'youtube_link', 1 );
564
}
565
566
/**
567
 * Core changes to do_shortcode (https://core.trac.wordpress.org/changeset/34747) broke "improper" shortcodes