Disable client-side nav in PC block when filters are inside (#51358)
* Disable client-side nav in PC block when filters are inside * Add changelog * Fix lint
This commit is contained in:
parent
9d76114472
commit
29ed02836a
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Product Collection: Disable client-side nav if filter blocks are detected inside
|
|
@ -499,11 +499,18 @@ class ProductCollection extends AbstractBlock {
|
||||||
*/
|
*/
|
||||||
private function is_block_compatible( $block_name ) {
|
private function is_block_compatible( $block_name ) {
|
||||||
// Check for explicitly unsupported blocks.
|
// Check for explicitly unsupported blocks.
|
||||||
if (
|
$unsupported_blocks = array(
|
||||||
'core/post-content' === $block_name ||
|
'core/post-content',
|
||||||
'woocommerce/mini-cart' === $block_name ||
|
'woocommerce/mini-cart',
|
||||||
'woocommerce/featured-product' === $block_name
|
'woocommerce/featured-product',
|
||||||
) {
|
'woocommerce/active-filters',
|
||||||
|
'woocommerce/price-filter',
|
||||||
|
'woocommerce/stock-filter',
|
||||||
|
'woocommerce/attribute-filter',
|
||||||
|
'woocommerce/rating-filter',
|
||||||
|
);
|
||||||
|
|
||||||
|
if ( in_array( $block_name, $unsupported_blocks, true ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue