Commit bd0833550a for woocommerce
commit bd0833550a2279c79a150aaa1f49a64881c78b88
Author: Jorge A. Torres <jorge.torres@automattic.com>
Date: Fri Dec 12 17:14:15 2025 +0000
Drop use of `wc_admin_show_legacy_coupon_menu` option (#62053)
diff --git a/plugins/woocommerce/changelog/fix-61860-legacy-coupon-menu b/plugins/woocommerce/changelog/fix-61860-legacy-coupon-menu
new file mode 100644
index 0000000000..8f357ba7f5
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-61860-legacy-coupon-menu
@@ -0,0 +1,4 @@
+Significance: patch
+Type: update
+
+Remove database option fetch for legacy coupon menu display preference.
diff --git a/plugins/woocommerce/src/Internal/Admin/CouponsMovedTrait.php b/plugins/woocommerce/src/Internal/Admin/CouponsMovedTrait.php
index c748b4681b..ce597361f2 100644
--- a/plugins/woocommerce/src/Internal/Admin/CouponsMovedTrait.php
+++ b/plugins/woocommerce/src/Internal/Admin/CouponsMovedTrait.php
@@ -90,12 +90,25 @@ trait CouponsMovedTrait {
* @return bool
*/
protected static function should_display_legacy_menu() {
- return ( get_option( self::$option_key, 1 ) && ! Features::is_enabled( 'navigation' ) );
+ /**
+ * Filter to determine whether to display the legacy coupon menu item.
+ *
+ * @since 10.5.0
+ *
+ * @param bool $display Whether the menu should be displayed or not.
+ * @return bool
+ */
+ return apply_filters(
+ 'wc_admin_show_legacy_coupon_menu',
+ ! Features::is_enabled( 'navigation' )
+ );
}
/**
* Set whether we should display the legacy coupon menu item.
*
+ * @deprecated 10.5.0 No longer in use.
+ *
* @param bool $display Whether the menu should be displayed or not.
*/
protected static function display_legacy_menu( $display = false ) {