diff options
Diffstat (limited to 'plugins/jetpack/3rd-party/woocommerce-services.php')
-rw-r--r-- | plugins/jetpack/3rd-party/woocommerce-services.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/jetpack/3rd-party/woocommerce-services.php b/plugins/jetpack/3rd-party/woocommerce-services.php index 0b1fd568..bdf1014e 100644 --- a/plugins/jetpack/3rd-party/woocommerce-services.php +++ b/plugins/jetpack/3rd-party/woocommerce-services.php @@ -39,13 +39,21 @@ class WC_Services_Installer { * Constructor */ public function __construct() { - $this->jetpack = Jetpack::init(); - + add_action( 'jetpack_loaded', array( $this, 'on_jetpack_loaded' ) ); add_action( 'admin_init', array( $this, 'add_error_notice' ) ); add_action( 'admin_init', array( $this, 'try_install' ) ); } /** + * Runs on Jetpack being ready to load its packages. + * + * @param Jetpack $jetpack object. + */ + public function on_jetpack_loaded( $jetpack ) { + $this->jetpack = $jetpack; + } + + /** * Verify the intent to install WooCommerce Services, and kick off installation. */ public function try_install() { |