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.

Метод класса: BlockTemplateUtils{}

Хуков нет.

Возвращает

true|false.

Использование

$result = BlockTemplateUtils::supports_block_templates( $template_type );
$template_type(строка)
Template type: wp_template or wp_template_part.
По умолчанию: wp_template

Код BlockTemplateUtils::supports_block_templates() WC 8.7.0

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;
}