Hide site visibility badge when "Launch Your Store" feature is disabled (#51159)
* Fix: put site visibility badge behind the launch your store feature flag * Add changelog
This commit is contained in:
parent
a7b957dbce
commit
0ef7d95aff
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Put site visibility badge behind the launch your store feature flag
|
|
@ -4,6 +4,8 @@ declare( strict_types = 1 );
|
||||||
|
|
||||||
namespace Automattic\WooCommerce\Internal\ComingSoon;
|
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.
|
* 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.
|
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance.
|
||||||
*/
|
*/
|
||||||
public function site_visibility_badge( $wp_admin_bar ) {
|
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(
|
$labels = array(
|
||||||
'coming-soon' => __( 'Coming soon', 'woocommerce' ),
|
'coming-soon' => __( 'Coming soon', 'woocommerce' ),
|
||||||
'store-coming-soon' => __( 'Store coming soon', 'woocommerce' ),
|
'store-coming-soon' => __( 'Store coming soon', 'woocommerce' ),
|
||||||
|
@ -60,6 +67,11 @@ class ComingSoonAdminBarBadge {
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public function output_css() {
|
public function output_css() {
|
||||||
|
// Early exit if LYS feature is disabled.
|
||||||
|
if ( ! Features::is_enabled( 'launch-your-store' ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( is_admin_bar_showing() ) {
|
if ( is_admin_bar_showing() ) {
|
||||||
echo '<style>
|
echo '<style>
|
||||||
#wpadminbar .quicklinks #wp-admin-bar-woocommerce-site-visibility-badge {
|
#wpadminbar .quicklinks #wp-admin-bar-woocommerce-site-visibility-badge {
|
||||||
|
|
Loading…
Reference in New Issue