Code Duplication    Length = 17-18 lines in 2 locations

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.

class.jetpack.php 1 location

@@ 1881-1897 (lines=17) @@
1878
	 * @param string $content Content of 'At A Glance' wp-admin dashboard widget.
1879
	 * @return string The modified content of the 'At a Glance' dashboard widget.
1880
	 */
1881
	public static function add_public_dashboard_glance_items( $content ) {
1882
		return
1883
			$content .
1884
			'<br><br>' .
1885
			wp_kses(
1886
				sprintf(
1887
					/* translators: URL for Jetpack dashboard. */
1888
					__( '<span class="%1$1s">This site is set to public.</span> <a href="%2$2s">Make private</a>.', 'jetpack' ),
1889
					esc_attr( 'jp-at-a-glance__site-public' ),
1890
					esc_url( admin_url( 'admin.php?page=jetpack#/security?term=private' ) )
1891
				),
1892
				array(
1893
					'a' => array( 'href' => true ),
1894
					'span' => array( 'class' => true ),
1895
				)
1896
			);
1897
	}
1898
1899
	/**
1900
	 * Loads modules from given array, otherwise all the currently active modules.