Automattic\WooCommerce\Blocks

BlockTemplatesController::get_template_path_from_woocommerce()publicWC 1.0

Returns the path of a template on the Blocks template folder.

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

Хуков нет.

Возвращает

Строку.

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

$BlockTemplatesController = new BlockTemplatesController();
$BlockTemplatesController->get_template_path_from_woocommerce( $template_slug, $template_type );
$template_slug(строка) (обязательный)
Block template slug e.g. single-product.
$template_type(строка)
wp_template or wp_template_part.
По умолчанию: 'wp_template'

Код BlockTemplatesController::get_template_path_from_woocommerce() WC 8.7.0

public function get_template_path_from_woocommerce( $template_slug, $template_type = 'wp_template' ) {
	return BlockTemplateUtils::get_templates_directory( $template_type ) . '/' . $template_slug . '.html';
}