diff --git a/plugins/woocommerce/changelog/fix-site-visibility-badge b/plugins/woocommerce/changelog/fix-site-visibility-badge new file mode 100644 index 00000000000..ea310491096 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-site-visibility-badge @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Put site visibility badge behind the launch your store feature flag diff --git a/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonAdminBarBadge.php b/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonAdminBarBadge.php index 0b65041e322..082944cd3b6 100644 --- a/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonAdminBarBadge.php +++ b/plugins/woocommerce/src/Internal/ComingSoon/ComingSoonAdminBarBadge.php @@ -4,6 +4,8 @@ declare( strict_types = 1 ); namespace Automattic\WooCommerce\Internal\ComingSoon; +use Automattic\WooCommerce\Admin\Features\Features; + /** * Adds hooks to add a badge to the WordPress admin bar showing site visibility. */ @@ -27,6 +29,11 @@ class ComingSoonAdminBarBadge { * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ public function site_visibility_badge( $wp_admin_bar ) { + // Early exit if LYS feature is disabled. + if ( ! Features::is_enabled( 'launch-your-store' ) ) { + return; + } + $labels = array( 'coming-soon' => __( 'Coming soon', 'woocommerce' ), 'store-coming-soon' => __( 'Store coming soon', 'woocommerce' ), @@ -60,6 +67,11 @@ class ComingSoonAdminBarBadge { * @internal */ public function output_css() { + // Early exit if LYS feature is disabled. + if ( ! Features::is_enabled( 'launch-your-store' ) ) { + return; + } + if ( is_admin_bar_showing() ) { echo '