| @@ 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. |
|
| @@ 1264-1276 (lines=13) @@ | ||
| 1261 | } |
|
| 1262 | } |
|
| 1263 | ||
| 1264 | function publicize_calypso_url() { |
|
| 1265 | if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
|
| 1266 | $site_suffix = Jetpack::build_raw_urls( home_url() ); |
|
| 1267 | } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
|
| 1268 | $site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
|
| 1269 | } |
|
| 1270 | ||
| 1271 | if ( $site_suffix ) { |
|
| 1272 | return Redirect::get_url( 'calypso-marketing-connections', array( 'site' => $site_suffix ) ); |
|
| 1273 | } else { |
|
| 1274 | return Redirect::get_url( 'calypso-marketing-connections-base' ); |
|
| 1275 | } |
|
| 1276 | } |
|
| 1277 | ||