Put product filters overlay template part behind feature flag (#49564)

* Put product filters overlay template part behind feature flag

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Roy Ho 2024-07-15 10:41:47 -07:00 committed by GitHub
parent 1c981034a7
commit a145575b01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 4 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Hide product filters overlay template part experimental feature from public release

View File

@ -59,10 +59,13 @@ class BlockTemplatesRegistry {
}
if ( BlockTemplateUtils::supports_block_templates( 'wp_template_part' ) ) {
$template_parts = array(
MiniCartTemplate::SLUG => new MiniCartTemplate(),
CheckoutHeaderTemplate::SLUG => new CheckoutHeaderTemplate(),
ProductFiltersOverlayTemplate::SLUG => new ProductFiltersOverlayTemplate(),
MiniCartTemplate::SLUG => new MiniCartTemplate(),
CheckoutHeaderTemplate::SLUG => new CheckoutHeaderTemplate(),
);
if ( Features::is_enabled( 'experimental-blocks' ) ) {
$template_parts[ ProductFiltersOverlayTemplate::SLUG ] = new ProductFiltersOverlayTemplate();
}
} else {
$template_parts = array();
}

View File

@ -316,9 +316,12 @@ class BlockTemplateUtils {
$wp_template_part_filenames = array(
'checkout-header.html',
'mini-cart.html',
'product-filters-overlay.html',
);
if ( Features::is_enabled( 'experimental-blocks' ) ) {
$wp_template_part_filenames[] = 'product-filters-overlay.html';
}
/*
* This may return the blockified directory for wp_templates.
* At the moment every template file has a corresponding blockified file.