Commit 92d33534d5 for woocommerce
commit 92d33534d52770d3e84efab793c2a5852efccb22
Author: Tung Du <dinhtungdu@gmail.com>
Date: Thu Apr 24 13:25:49 2025 +0700
Fix: enable filter blocks in the Widgets editor (#57487)
* fix: enable filter blocks in widget editor
* chore: changelog
* chore: group legacy blocks
diff --git a/plugins/woocommerce/changelog/fix-enable-product-filters-in-widget-editor b/plugins/woocommerce/changelog/fix-enable-product-filters-in-widget-editor
new file mode 100644
index 0000000000..f1aacc7ff2
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-enable-product-filters-in-widget-editor
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Product Filters: enable filter blocks in the Widgets editor.
diff --git a/plugins/woocommerce/src/Blocks/BlockTypesController.php b/plugins/woocommerce/src/Blocks/BlockTypesController.php
index 11aee505fa..87e6a1a480 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypesController.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypesController.php
@@ -371,9 +371,7 @@ final class BlockTypesController {
*/
protected function get_widget_area_block_types() {
return array(
- 'ActiveFilters',
'AllReviews',
- 'AttributeFilter',
'Breadcrumbs',
'CartLink',
'CatalogSorting',
@@ -381,16 +379,33 @@ final class BlockTypesController {
'CustomerAccount',
'FeaturedCategory',
'FeaturedProduct',
- 'FilterWrapper',
'MiniCart',
- 'PriceFilter',
'ProductCategories',
'ProductResultsCount',
'ProductSearch',
- 'RatingFilter',
'ReviewsByCategory',
'ReviewsByProduct',
+ 'ProductFilters',
+ 'ProductFilterStatus',
+ 'ProductFilterPrice',
+ 'ProductFilterPriceSlider',
+ 'ProductFilterAttribute',
+ 'ProductFilterRating',
+ 'ProductFilterActive',
+ 'ProductFilterRemovableChips',
+ 'ProductFilterClearButton',
+ 'ProductFilterCheckboxList',
+ 'ProductFilterChips',
+
+ // Keep hidden legacy filter blocks for backward compatibility.
+ 'ActiveFilters',
+ 'AttributeFilter',
+ 'FilterWrapper',
+ 'PriceFilter',
+ 'RatingFilter',
'StockFilter',
+ // End: legacy filter blocks.
+
// Below product grids are hidden from inserter however they could have been used in widgets.
// Keep them for backward compatibility.
'HandpickedProducts',
@@ -401,6 +416,7 @@ final class BlockTypesController {
'ProductsByAttribute',
'ProductCategory',
'ProductTag',
+ // End: legacy product grids blocks.
);
}