From 0394bed9fd538c150da12f1b5a5becacb6d69924 Mon Sep 17 00:00:00 2001 From: Lucio Giannotta Date: Tue, 3 Jan 2023 16:59:48 +0100 Subject: [PATCH] Hide `core/no-results` as default in Product Query if WP <= 5.9 `core/no-results` was not available until WP 6.0. --- assets/js/blocks/product-query/constants.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/blocks/product-query/constants.ts b/assets/js/blocks/product-query/constants.ts index 39c84b8539d..b78163cbb73 100644 --- a/assets/js/blocks/product-query/constants.ts +++ b/assets/js/blocks/product-query/constants.ts @@ -1,7 +1,7 @@ /** * External dependencies */ -import { getSetting } from '@woocommerce/settings'; +import { getSetting, isWpVersion } from '@woocommerce/settings'; import type { InnerBlockTemplate } from '@wordpress/blocks'; /** @@ -110,5 +110,7 @@ export const INNER_BLOCKS_TEMPLATE: InnerBlockTemplate[] = [ }, [], ], - [ 'core/query-no-results' ], + ...( isWpVersion( '6.0', '>=' ) + ? [ [ 'core/query-no-results' ] as InnerBlockTemplate ] + : [] ), ];