Code Duplication    Length = 5-7 lines in 2 locations

modules/publicize/publicize.php 1 location

@@ 1238-1242 (lines=5) @@
1235
1236
function publicize_calypso_url() {
1237
	$calypso_sharing_url = 'https://wordpress.com/sharing/';
1238
	if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) {
1239
		$site_suffix = Jetpack::build_raw_urls( home_url() );
1240
	} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
1241
		$site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
1242
	}
1243
1244
	if ( $site_suffix ) {
1245
		return $calypso_sharing_url . $site_suffix;

class.jetpack-gutenberg.php 1 location

@@ 568-574 (lines=7) @@
565
			? filemtime( JETPACK__PLUGIN_DIR . $blocks_dir . 'editor.js' )
566
			: JETPACK__VERSION;
567
568
		if ( method_exists( 'Jetpack', 'build_raw_urls' ) ) {
569
			$site_fragment = Jetpack::build_raw_urls( home_url() );
570
		} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
571
			$site_fragment = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
572
		} else {
573
			$site_fragment = '';
574
		}
575
576
		wp_enqueue_script(
577
			'jetpack-blocks-editor',