PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | jetpack_vendor/automattic/jetpack-sync/src/class-functions.php +19 -0 16.2 → 16.3-a.7 View file →
@@ -10,8 +10,9 @@
10 10 use Automattic\Jetpack\Connection\Manager;
11 11 use Automattic\Jetpack\Connection\Urls;
12 12 use Automattic\Jetpack\Constants;
13 13 use Automattic\Jetpack\Modules as Jetpack_Modules;
14 +use Automattic\Jetpack\Status;
14 15
15 16 /**
16 17 * Utility functions to generate data synced to wpcom
17 18 */
@@ -589,8 +590,26 @@
589 590 * @return bool Theme is a Full Site Editing theme.
590 591 */
591 592 public static function get_is_fse_theme() {
592 593 return wp_is_block_theme();
594 + }
595 +
596 + /**
597 + * Returns the site's visibility as a `blog_public` value, or -1 when Jetpack considers the site private.
598 + *
599 + * Lets `jetpack_is_private_site` report the site as private to WordPress.com without changing
600 + * the `blog_public` option itself, since core and other plugins do not expect a -1 there.
601 + *
602 + * @since 5.2.0
603 + *
604 + * @return int -1 when private, otherwise the stored `blog_public` value.
605 + */
606 + public static function get_site_visibility() {
607 + if ( ( new Status() )->is_private_site() ) {
608 + return -1;
609 + }
610 +
611 + return (int) get_option( 'blog_public', 1 );
593 612 }
594 613
595 614 /**
596 615 * Wraps data in a way so that we can distinguish between objects and array and also prevent object recursion.