Automattic\WooCommerce\Blocks

BlockTemplatesController::__construct()publicWC 1.0

Constructor.

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

Хуков нет.

Возвращает

null. Ничего.

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

$BlockTemplatesController = new BlockTemplatesController();
$BlockTemplatesController->__construct( $package );
$package(Package) (обязательный)
An instance of Package.

Код BlockTemplatesController::__construct() WC 7.3.0

public function __construct( Package $package ) {
	$this->package = $package;

	// This feature is gated for WooCommerce versions 6.0.0 and above.
	if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '6.0.0', '>=' ) ) {
		$root_path                      = plugin_dir_path( __DIR__ ) . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR;
		$this->templates_directory      = $root_path . BlockTemplateUtils::DIRECTORY_NAMES['TEMPLATES'];
		$this->template_parts_directory = $root_path . BlockTemplateUtils::DIRECTORY_NAMES['TEMPLATE_PARTS'];
		$this->init();
	}
}