Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove LYS badge from WPCOM sites #1519

Merged
merged 5 commits into from
Sep 25, 2024
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
9 changes: 4 additions & 5 deletions includes/class-wc-calypso-bridge-coming-soon.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Class WC_Calypso_Bridge_Coming_Soon
*
* @since 2.6.0
* @version 2.6.0
* @version x.x.x
*
* Handle Coming Soon mode.
*/
Expand Down Expand Up @@ -40,7 +40,7 @@ public function __construct() {
add_filter( 'pre_option_woocommerce_coming_soon', array( $this, 'override_option_woocommerce_coming_soon' ) );
add_filter( 'pre_update_option_woocommerce_coming_soon', array( $this, 'override_update_woocommerce_coming_soon' ), 10, 2 );
// Admin bar menu is not only shown in the admin area but also in the front end when the admin user is logged in.
add_action( 'admin_bar_menu', array( $this, 'possibly_remove_site_visibility_badge' ), 32 );
add_action( 'admin_bar_menu', array( $this, 'remove_site_visibility_badge' ), 32 );

if ( is_admin() ) {
add_filter( 'plugins_loaded', array( $this, 'maybe_add_admin_notice' ) );
Expand Down Expand Up @@ -208,9 +208,8 @@ function () use ( $message, $notice_type ) {
* @param WP_Admin_Bar $wp_admin_bar The admin bar instance.
* @return void
*/
public function possibly_remove_site_visibility_badge( $wp_admin_bar ) {
// TODO: Remove feature check once the site visibility badge is behind feature flag in core.
if ( wc_calypso_bridge_is_trial_plan() || ! $this->is_feature_enabled() ) {
public function remove_site_visibility_badge( $wp_admin_bar ) {
if ( $wp_admin_bar && $this->is_feature_enabled() ) {
$wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' );
}
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This section describes how to install the plugin and get it working.

= Unreleased =
* Re-enable Site visibility settings tab for free trial plans #1512
* Remove LYS badge from WPCOM sites #1519
* Remove setting demo store option on ecommerce sites by default #1518

= 2.6.0 =
Expand Down
Loading