Cherry pick 51664 into release/9.4 (#51849)

* Add core feature for site visibility badge (#51664)

* Add site_visibility_badge feature

* Update feature check on badge

Previously the WooCommerce Admin LYS feature flag was used, however this is slated to be removed in an upcoming release. This is updated to use the core level feature flag for the badge.

* Add changelog

* Fix lint issues

* Revert "Fix lint issues"

This reverts commit cf05d2b74f.

* Lint fixes

* lint

* Prep for cherry pick 51664

---------

Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
This commit is contained in:
github-actions[bot] 2024-10-02 06:43:53 -07:00 committed by GitHub
parent 135f6c9389
commit 820cb1c308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 10 deletions

View File

@ -220,6 +220,7 @@ WooCommerce comes with some sample data you can use to see how products look; im
* Fix - Use `get_filtered_ids` consistently in `reports/taxes` and `reports/taxes/stats` datastores [#51219](https://github.com/woocommerce/woocommerce/pull/51219) * Fix - Use `get_filtered_ids` consistently in `reports/taxes` and `reports/taxes/stats` datastores [#51219](https://github.com/woocommerce/woocommerce/pull/51219)
* Fix - wc_get_cart_url should only return current URL if on the cart page. This excludes the usage of WOOCOMMERCE_CART. [#51384](https://github.com/woocommerce/woocommerce/pull/51384) * Fix - wc_get_cart_url should only return current URL if on the cart page. This excludes the usage of WOOCOMMERCE_CART. [#51384](https://github.com/woocommerce/woocommerce/pull/51384)
* Fix - Wrap parse_str under a check to resolve deprecation notice [#51474](https://github.com/woocommerce/woocommerce/pull/51474) * Fix - Wrap parse_str under a check to resolve deprecation notice [#51474](https://github.com/woocommerce/woocommerce/pull/51474)
* Add - Add core feature for site visibility badge [#51664](https://github.com/woocommerce/woocommerce/pull/51664)
* Add - Added a Load More button to product lists on the Extensions page, to request additional search results from WooCommerce.com. [#51413](https://github.com/woocommerce/woocommerce/pull/51413) * Add - Added a Load More button to product lists on the Extensions page, to request additional search results from WooCommerce.com. [#51413](https://github.com/woocommerce/woocommerce/pull/51413)
* Add - Add endpoint title to the document title. [#50900](https://github.com/woocommerce/woocommerce/pull/50900) * Add - Add endpoint title to the document title. [#50900](https://github.com/woocommerce/woocommerce/pull/50900)
* Add - Add global_unique_id parameter to products REST API [#51264](https://github.com/woocommerce/woocommerce/pull/51264) * Add - Add global_unique_id parameter to products REST API [#51264](https://github.com/woocommerce/woocommerce/pull/51264)

View File

@ -4,7 +4,8 @@ declare( strict_types = 1 );
namespace Automattic\WooCommerce\Internal\ComingSoon; namespace Automattic\WooCommerce\Internal\ComingSoon;
use Automattic\WooCommerce\Admin\Features\Features; use Automattic\WooCommerce\Utilities\FeaturesUtil;
/** /**
* 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.
@ -30,7 +31,7 @@ class ComingSoonAdminBarBadge {
*/ */
public function site_visibility_badge( $wp_admin_bar ) { public function site_visibility_badge( $wp_admin_bar ) {
// Early exit if LYS feature is disabled. // Early exit if LYS feature is disabled.
if ( ! Features::is_enabled( 'launch-your-store' ) ) { if ( ! FeaturesUtil::feature_is_enabled( 'site_visibility_badge' ) ) {
return; return;
} }
@ -68,7 +69,7 @@ class ComingSoonAdminBarBadge {
*/ */
public function output_css() { public function output_css() {
// Early exit if LYS feature is disabled. // Early exit if LYS feature is disabled.
if ( ! Features::is_enabled( 'launch-your-store' ) ) { if ( ! FeaturesUtil::feature_is_enabled( 'site_visibility_badge' ) ) {
return; return;
} }

View File

@ -224,6 +224,18 @@ class FeaturesController {
'is_legacy' => true, 'is_legacy' => true,
'is_experimental' => false, 'is_experimental' => false,
), ),
'site_visibility_badge' => array(
'name' => __( 'Site visibility badge', 'woocommerce' ),
'description' => __(
'Enable the site visibility badge in the WordPress admin bar',
'woocommerce'
),
'enabled_by_default' => true,
'disable_ui' => false,
'is_legacy' => true,
'is_experimental' => false,
'disabled' => false,
),
'hpos_fts_indexes' => array( 'hpos_fts_indexes' => array(
'name' => __( 'HPOS Full text search indexes', 'woocommerce' ), 'name' => __( 'HPOS Full text search indexes', 'woocommerce' ),
'description' => __( 'description' => __(