Small cleanup

This commit is contained in:
Bart Kalisz 2024-09-13 14:44:08 +02:00 committed by Christopher Allford
parent ce7356292f
commit 3bd104cd4a
No known key found for this signature in database
GPG Key ID: 80E44C778F08A88E
1 changed files with 1 additions and 3 deletions

View File

@ -1042,12 +1042,10 @@ class ProductCollection extends AbstractBlock {
);
}
$collection_name = $this->parsed_block['attrs']['collection'];
$is_handpicked_collection = 'woocommerce/product-collection/hand-picked' === $collection;
// For the Hand-Picked collection, we need to always display no results
// if no products were picked. To achieve this, we need to set post__in to [-1]
// so that there are no IDs to be intersected.
$is_handpicked_collection = 'woocommerce/product-collection/hand-picked' === $collection;
return array(
'post__in' => $is_handpicked_collection ? array( -1 ) : array(),
);