Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
load Interactivity API in Bootstrap.php file
Browse files Browse the repository at this point in the history
  • Loading branch information
gigitux committed Aug 18, 2023
1 parent de5c3e0 commit eff5e29
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Domain/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function __construct( Container $container ) {
protected function init() {
$this->register_dependencies();
$this->register_payment_methods();
$this->load_interactivity_api();

// This is just a temporary solution to make sure the migrations are run. We have to refactor this. More details: https://github.com/woocommerce/woocommerce-blocks/issues/10196.
if ( $this->package->get_version() !== $this->package->get_version_stored_on_db() ) {
Expand Down Expand Up @@ -225,6 +226,21 @@ function() {
);
}

/**
* Load and set up the Interactivity API if enabled.
*/
protected function load_interactivity_api() {
// phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
$is_enabled = apply_filters(
'woocommerce_blocks_enable_interactivity_api',
true
);

if ( $is_enabled ) {
require_once '../Interactivity/load.php';
}
}

/**
* Register core dependencies with the container.
*/
Expand Down

0 comments on commit eff5e29

Please sign in to comment.