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

Commit

Permalink
Don't fire woocommerce_blocks_loaded if WC version is not met (#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
senadir authored Sep 30, 2021
1 parent 64e7615 commit 3f7c3e5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Domain/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,19 @@ class Bootstrap {
public function __construct( Container $container ) {
$this->container = $container;
$this->package = $container->get( Package::class );
$this->init();
/**
* Usable as a safe event hook for when the plugin has been loaded.
*/
do_action( 'woocommerce_blocks_loaded' );
if ( $this->has_core_dependencies() ) {
$this->init();
/**
* Usable as a safe event hook for when the plugin has been loaded.
*/
do_action( 'woocommerce_blocks_loaded' );
}
}

/**
* Init the package - load the blocks library and define constants.
*/
protected function init() {
if ( ! $this->has_core_dependencies() ) {
return;
}
$this->register_dependencies();
$this->register_payment_methods();

Expand Down

0 comments on commit 3f7c3e5

Please sign in to comment.