Code Duplication    Length = 17-18 lines in 2 locations

class.jetpack.php 1 location

@@ 1862-1878 (lines=17) @@
1859
	 * @param string $content Content of 'At A Glance' wp-admin dashboard widget.
1860
	 * @return string The modified content of the 'At a Glance' dashboard widget.
1861
	 */
1862
	public static function add_public_dashboard_glance_items( $content ) {
1863
		return 
1864
			$content . 
1865
			'<br><br>' .
1866
			wp_kses(
1867
				sprintf(
1868
					/* translators: URL for Jetpack dashboard. */
1869
					__( '<span class="%1$1s">This site is set to public.</span> <a href="%2$2s">Make private</a>.', 'jetpack' ),
1870
					esc_attr( 'jp-at-a-glance__site-public' ),
1871
					esc_url( admin_url( 'admin.php?page=jetpack#/security?term=private' ) )
1872
				),
1873
				array(
1874
					'a' => array( 'href' => true ),
1875
					'span' => array( 'class' => true ),
1876
				)
1877
			);
1878
	}
1879
1880
	/**
1881
	 * Loads modules from given array, otherwise all the currently active modules.

modules/private/class-jetpack-private.php 1 location

@@ 323-340 (lines=18) @@
320
	 * @param string $content Content of At A Glance wp-admin dashboard widget.
321
	 * @return string The modified content of the 'At a Glance' dashboard widget.
322
	 */
323
	public static function add_private_dashboard_glance_items( $content ) {
324
		add_filter( 'privacy_on_link_text', '__return_empty_string' );
325
326
		return $content .
327
			'<br><br>' .
328
			wp_kses(
329
				sprintf(
330
					/* translators: URL for Jetpack dashboard. */
331
					__( '<span class="%1$1s">This site is set to private.</span> <a href="%2$2s">Make public</a>.', 'jetpack' ),
332
					esc_attr( 'jp-at-a-glance__site-private' ),
333
					esc_url( admin_url( 'admin.php?page=jetpack#/security?term=private' ) )
334
				),
335
				array(
336
					'a'    => array( 'href' => true ),
337
					'span' => array( 'class' => true ),
338
				)
339
			);
340
	}
341
342
	/**
343
	 * Returns the private page template for OPML.