Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::supports_block_templates()public staticWC 1.0

Checks to see if they are using a compatible version of WP, or if not they have a compatible version of the Gutenberg plugin installed.

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

true|false.

Usage

$result = BlockTemplateUtils::supports_block_templates( $template_type );
$template_type(string)
Template type: wp_template or wp_template_part.
Default: wp_template

BlockTemplateUtils::supports_block_templates() code WC 9.4.2

public static function supports_block_templates( $template_type = 'wp_template' ) {
	if ( 'wp_template_part' === $template_type && ( wc_current_theme_is_fse_theme() || current_theme_supports( 'block-template-parts' ) ) ) {
		return true;
	} elseif ( 'wp_template' === $template_type && wc_current_theme_is_fse_theme() ) {
		return true;
	}
	return false;
}