Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Hide core/no-results as default in Product Query if WP <= 5.9 (#8082)
Browse files Browse the repository at this point in the history
`core/no-results` was not available until WP 6.0.
  • Loading branch information
sunyatasattva authored Jan 3, 2023
1 parent bff4b96 commit f08845b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/blocks/product-query/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { getSetting } from '@woocommerce/settings';
import { getSetting, isWpVersion } from '@woocommerce/settings';
import type { InnerBlockTemplate } from '@wordpress/blocks';

/**
Expand Down Expand Up @@ -110,5 +110,7 @@ export const INNER_BLOCKS_TEMPLATE: InnerBlockTemplate[] = [
},
[],
],
[ 'core/query-no-results' ],
...( isWpVersion( '6.0', '>=' )
? [ [ 'core/query-no-results' ] as InnerBlockTemplate ]
: [] ),
];

0 comments on commit f08845b

Please sign in to comment.