Code Duplication    Length = 14-18 lines in 2 locations

modules/widgets/contact-info.php 1 location

@@ 22-39 (lines=18) @@
19
		/**
20
		 * Constructor
21
		 */
22
		function __construct() {
23
			$widget_ops = array(
24
				'classname'                   => 'widget_contact_info',
25
				'description'                 => __( 'Display a map with your location, hours, and contact information.', 'jetpack' ),
26
				'customize_selective_refresh' => true,
27
			);
28
			parent::__construct(
29
				'widget_contact_info',
30
				/** This filter is documented in modules/widgets/facebook-likebox.php */
31
				apply_filters( 'jetpack_widget_name', __( 'Contact Info & Map', 'jetpack' ) ),
32
				$widget_ops
33
			);
34
			$this->alt_option_name = 'widget_contact_info';
35
36
			if ( is_customize_preview() ) {
37
				add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
38
			}
39
		}
40
41
		/**
42
		 * Enqueue scripts and styles.

modules/widgets/google-translate.php 1 location

@@ 28-41 (lines=14) @@
25
	/**
26
	 * Register widget with WordPress.
27
	 */
28
	function __construct() {
29
		parent::__construct(
30
			'google_translate_widget',
31
			/** This filter is documented in modules/widgets/facebook-likebox.php */
32
			apply_filters( 'jetpack_widget_name', __( 'Google Translate', 'jetpack' ) ),
33
			array(
34
				'description'                 => __( 'Provide your readers with the option to translate your site into their preferred language.', 'jetpack' ),
35
				'customize_selective_refresh' => true,
36
			)
37
		);
38
		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
39
40
		$this->default_title = esc_html__( 'Translate', 'jetpack' );
41
	}
42
43
	/**
44
	 * Enqueue frontend JS scripts.