| @@ 686-697 (lines=12) @@ | ||
| 683 | * |
|
| 684 | * @return string the customisation URL or null if it couldn't be determinde. |
|
| 685 | */ |
|
| 686 | function get_sharing_buttons_customisation_url() { |
|
| 687 | if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
|
| 688 | $site_suffix = Jetpack::build_raw_urls( home_url() ); |
|
| 689 | } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
|
| 690 | $site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
|
| 691 | } |
|
| 692 | ||
| 693 | if ( $site_suffix ) { |
|
| 694 | return Automattic\Jetpack\Redirect::get_url( 'calypso-marketing-sharing-buttons', array( 'site' => $site_suffix ) ); |
|
| 695 | } |
|
| 696 | return null; |
|
| 697 | } |
|
| 698 | ||
| 699 | /** |
|
| 700 | * Append sharing links to text. |
|
| @@ 362-373 (lines=12) @@ | ||
| 359 | ); |
|
| 360 | return in_array( $origin, $allowed, true ) ? $origin : 'https://wordpress.com'; |
|
| 361 | ||
| 362 | function get_site_suffix() { |
|
| 363 | if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
|
| 364 | $site_suffix = Jetpack::build_raw_urls( home_url() ); |
|
| 365 | } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
|
| 366 | $site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
|
| 367 | } |
|
| 368 | ||
| 369 | if ( $site_suffix ) { |
|
| 370 | return "/${site_suffix}"; |
|
| 371 | } |
|
| 372 | return ''; |
|
| 373 | } |
|
| 374 | } |
|
| 375 | ||
| 376 | /** |
|
| @@ 384-395 (lines=12) @@ | ||
| 381 | * |
|
| 382 | * @return string |
|
| 383 | */ |
|
| 384 | private function get_site_suffix() { |
|
| 385 | if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
|
| 386 | $site_suffix = Jetpack::build_raw_urls( home_url() ); |
|
| 387 | } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
|
| 388 | $site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
|
| 389 | } |
|
| 390 | ||
| 391 | if ( $site_suffix ) { |
|
| 392 | return "/${site_suffix}"; |
|
| 393 | } |
|
| 394 | return ''; |
|
| 395 | } |
|
| 396 | ||
| 397 | /** |
|
| 398 | * Returns the Calypso URL that displays either the current post type list (if no args |
|