Automattic\WooCommerce\Blocks\Domain

Bootstrap::init()protectedWC 1.0

Init the package - load the blocks library and define constants.

{} Это метод класса: Bootstrap{}

Хуков нет.

Возвращает

null. Ничего.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->init();

Код Bootstrap::init() WC 6.8.0

protected function init() {
	$this->register_dependencies();
	$this->register_payment_methods();

	add_action(
		'admin_init',
		function() {
			InboxNotifications::create_surface_cart_checkout_blocks_notification();
		},
		10,
		0
	);

	$is_rest = wc()->is_rest_api_request();

	// Load assets in admin and on the frontend.
	if ( ! $is_rest ) {
		$this->add_build_notice();
		$this->container->get( AssetDataRegistry::class );
		$this->container->get( Installer::class );
		$this->container->get( AssetsController::class );
	}
	$this->container->get( DraftOrders::class )->init();
	$this->container->get( CreateAccount::class )->init();
	$this->container->get( StoreApi::class )->init();
	$this->container->get( GoogleAnalytics::class );
	$this->container->get( BlockTypesController::class );
	$this->container->get( BlockTemplatesController::class );
	$this->container->get( ProductSearchResultsTemplate::class );
	$this->container->get( ClassicTemplatesCompatibility::class );
	if ( $this->package->feature()->is_feature_plugin_build() ) {
		$this->container->get( PaymentsApi::class );
	}
}