Code Duplication    Length = 8-13 lines in 2 locations

class.jetpack.php 1 location

@@ 1130-1137 (lines=8) @@
1127
			);
1128
		}
1129
1130
		if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) ) {
1131
			wp_register_script(
1132
				'jetpack-gallery-settings',
1133
				self::get_file_url_for_environment( '_inc/build/gallery-settings.min.js', '_inc/gallery-settings.js' ),
1134
				array( 'media-views' ),
1135
				'20121225'
1136
			);
1137
		}
1138
1139
		if ( ! wp_script_is( 'jetpack-twitter-timeline', 'registered' ) ) {
1140
			wp_register_script(

functions.gallery.php 1 location

@@ 57-69 (lines=13) @@
54
	 * Registers/enqueues the gallery settings admin js.
55
	 */
56
	function wp_enqueue_media() {
57
		if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) ) {
58
			/**
59
			 * This only happens if we're not in Jetpack, but on WPCOM instead.
60
			 * This is the correct path for WPCOM.
61
			 */
62
			$asset_tools = new Asset_Tools();
63
			wp_register_script(
64
				'jetpack-gallery-settings',
65
				$asset_tools->get_file_url_for_environment( '_inc/build/gallery-settings.min.js', '_inc/gallery-settings.js' ),
66
				array( 'media-views' ),
67
				'20121225'
68
			);
69
		}
70
71
		wp_enqueue_script( 'jetpack-gallery-settings' );
72
	}