|
@@ 367-378 (lines=12) @@
|
| 364 |
|
); |
| 365 |
|
return in_array( $origin, $allowed, true ) ? $origin : 'https://wordpress.com'; |
| 366 |
|
|
| 367 |
|
function get_site_suffix() { |
| 368 |
|
if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
| 369 |
|
$site_suffix = Jetpack::build_raw_urls( home_url() ); |
| 370 |
|
} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
| 371 |
|
$site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
| 372 |
|
} |
| 373 |
|
|
| 374 |
|
if ( $site_suffix ) { |
| 375 |
|
return "/${site_suffix}"; |
| 376 |
|
} |
| 377 |
|
return ''; |
| 378 |
|
} |
| 379 |
|
} |
| 380 |
|
|
| 381 |
|
/** |
|
@@ 389-400 (lines=12) @@
|
| 386 |
|
* |
| 387 |
|
* @return string |
| 388 |
|
*/ |
| 389 |
|
private function get_site_suffix() { |
| 390 |
|
if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
| 391 |
|
$site_suffix = Jetpack::build_raw_urls( home_url() ); |
| 392 |
|
} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
| 393 |
|
$site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
| 394 |
|
} |
| 395 |
|
|
| 396 |
|
if ( $site_suffix ) { |
| 397 |
|
return "/${site_suffix}"; |
| 398 |
|
} |
| 399 |
|
return ''; |
| 400 |
|
} |
| 401 |
|
|
| 402 |
|
/** |
| 403 |
|
* Returns the Calypso URL that displays either the current post type list (if no args |