Code Duplication    Length = 16-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/wordpress-post-widget/class.jetpack-display-posts-widget-base.php 1 location

@@ 23-38 (lines=16) @@
20
	 */
21
	public $service_url = 'https://public-api.wordpress.com/rest/v1.1/';
22
23
	public function __construct() {
24
		parent::__construct(
25
		// internal id
26
			'jetpack_display_posts_widget',
27
			/** This filter is documented in modules/widgets/facebook-likebox.php */
28
			apply_filters( 'jetpack_widget_name', __( 'Display WordPress Posts', 'jetpack' ) ),
29
			array(
30
				'description' => __( 'Displays a list of recent posts from another WordPress.com or Jetpack-enabled blog.', 'jetpack' ),
31
				'customize_selective_refresh' => true,
32
			)
33
		);
34
35
		if ( is_customize_preview() ) {
36
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
37
		}
38
	}
39
40
	/**
41
	 * Enqueue CSS and JavaScript.