WordPress at Your Fingertips
function is not described

WC_Template_Loader::has_block_template() private WC 5.5.0

Checks whether a block template with that name exists.

{} It's a method of the class: WC_Template_Loader{}

No Hooks.

Return

true|false.

Usage

$result = WC_Template_Loader::has_block_template( $template_name );
$template_name(string) (required)
Template to check.

Changelog

Since 5.5.0 Introduced.

Code of WC_Template_Loader::has_block_template() WC 5.7.1

private static function has_block_template( $template_name ) {
	if ( ! $template_name ) {
		return false;
	}

	return is_readable(
		get_stylesheet_directory() . '/block-templates/' . $template_name . '.html'
	);
}