@@ 336-347 (lines=12) @@ | ||
333 | ); |
|
334 | return in_array( $origin, $whitelist ) ? $origin : 'https://wordpress.com'; |
|
335 | ||
336 | function get_site_suffix() { |
|
337 | if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
|
338 | $site_suffix = Jetpack::build_raw_urls( home_url() ); |
|
339 | } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
|
340 | $site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
|
341 | } |
|
342 | ||
343 | if ( $site_suffix ) { |
|
344 | return "/${site_suffix}"; |
|
345 | } |
|
346 | return ''; |
|
347 | } |
|
348 | } |
|
349 | ||
350 | /** |
|
@@ 358-369 (lines=12) @@ | ||
355 | * |
|
356 | * @return string |
|
357 | */ |
|
358 | private function get_site_suffix() { |
|
359 | if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) { |
|
360 | $site_suffix = Jetpack::build_raw_urls( home_url() ); |
|
361 | } elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) { |
|
362 | $site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() ); |
|
363 | } |
|
364 | ||
365 | if ( $site_suffix ) { |
|
366 | return "/${site_suffix}"; |
|
367 | } |
|
368 | return ''; |
|
369 | } |
|
370 | ||
371 | /** |
|
372 | * Returns the Calypso URL that displays either the current post type list (if no args |