diff --git a/plugins/woocommerce/changelog/disable-new-navigation b/plugins/woocommerce/changelog/disable-new-navigation new file mode 100644 index 00000000000..3a246245bd1 --- /dev/null +++ b/plugins/woocommerce/changelog/disable-new-navigation @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Disable the new navigation as the feature is on hold. diff --git a/plugins/woocommerce/src/Internal/Features/FeaturesController.php b/plugins/woocommerce/src/Internal/Features/FeaturesController.php index 323550a33bf..9a10192ad11 100644 --- a/plugins/woocommerce/src/Internal/Features/FeaturesController.php +++ b/plugins/woocommerce/src/Internal/Features/FeaturesController.php @@ -606,6 +606,26 @@ class FeaturesController { $disabled = true; $desc_tip = __( 'WooCommerce Admin has been disabled', 'woocommerce' ); } elseif ( 'new_navigation' === $feature_id ) { + $disabled = ! $this->feature_is_enabled( $feature_id ); + + if ( $disabled ) { + $update_text = sprintf( + // translators: 1: line break tag. + __( '%1$s The development of this feature is currently on hold.', 'woocommerce' ), + '
' + ); + } else { + $update_text = sprintf( + // translators: 1: line break tag. + __( + '%1$s This navigation will soon become unavailable while we make necessary improvements. + If you turn it off now, you will not be able to turn it back on.', + 'woocommerce' + ), + '
' + ); + } + $needs_update = version_compare( get_bloginfo( 'version' ), '5.6', '<' ); if ( $needs_update && current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { $update_text = sprintf( @@ -615,8 +635,11 @@ class FeaturesController { '', '' ); + $disabled = true; + } + + if ( ! empty( $update_text ) ) { $description .= $update_text; - $disabled = true; } } diff --git a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js index d706dbab89e..a7922f15b88 100644 --- a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js +++ b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js @@ -1702,13 +1702,12 @@ test.describe('Settings API tests: CRUD', () => { "type": "checkbox", }) ])); - expect(responseJSON).toEqual( expect.arrayContaining([ expect.objectContaining({ "id": "woocommerce_navigation_enabled", "label": "Navigation", - "description": "Adds the new WooCommerce navigation experience to the dashboard", + "description": expect.stringContaining("Adds the new WooCommerce navigation experience to the dashboard"), "type": "checkbox", "value": expect.any(String), })