Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Do not display the Blaze UI on private or unlaunched sites.
19 changes: 17 additions & 2 deletions projects/packages/blaze/src/class-blaze.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public function register() {
*/
public static function should_initialize() {
$should_initialize = true;
$user_data = ( defined( 'IS_WPCOM' ) && IS_WPCOM )
$is_wpcom = defined( 'IS_WPCOM' ) && IS_WPCOM;
$user_data = $is_wpcom
? array( 'user_locale' => get_user_locale() )
: ( new Jetpack_Connection() )->get_connected_user_data();

Expand Down Expand Up @@ -92,12 +93,26 @@ public static function should_initialize() {

// Only show the UI on WordPress.com Simple and WoA sites for now.
if (
! ( defined( 'IS_WPCOM' ) && IS_WPCOM )
! $is_wpcom
&& ! ( new Host() )->is_woa_site()
) {
$should_initialize = false;
}

/*
* Do not show the UI on private sites
* nor on sites that have not been launched yet.
*/
if (
'-1' === get_option( 'blog_public' )
|| (
( function_exists( 'site_is_coming_soon' ) && \site_is_coming_soon() )
|| (bool) get_option( 'wpcom_public_coming_soon' )
)
) {
$should_initialize = false;
}

/**
* Filter to disable all Blaze functionality.
*
Expand Down