Added Hand-Picked Collection Handler
This commit is contained in:
parent
f1cb75592f
commit
bc291f9518
|
@ -1829,6 +1829,18 @@ class ProductCollection extends AbstractBlock {
|
|||
* Registers any handlers for the core collections.
|
||||
*/
|
||||
protected function register_core_collections() {
|
||||
$this->register_collection_handlers(
|
||||
'woocommerce/product-collection/hand-picked',
|
||||
function ( $collection_args, $common_query_values, $query ) {
|
||||
// Hand-picked product collections should hide the results if no products are selected.
|
||||
if ( empty( $query['handpicked_products'] ) ) {
|
||||
return array(
|
||||
'post__in' => array( -1 ),
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$this->register_collection_handlers(
|
||||
'woocommerce/product-collection/related',
|
||||
function ( $collection_args ) {
|
||||
|
|
Loading…
Reference in New Issue