Skip to content

Commit

Permalink
Merge pull request #36 from woocommerce/update/do-not-initialize-if-w…
Browse files Browse the repository at this point in the history
…c-is-not-activated

Do not initialize the plugin if WC is not activated
  • Loading branch information
moon0326 authored Apr 13, 2022
2 parents 39508b3 + 8bac9a2 commit 915cf54
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions woocommerce-admin-test-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ function add_extension_register_script() {
wp_enqueue_style( 'woocommerce-admin-test-helper' );
}

add_action( 'admin_enqueue_scripts', 'add_extension_register_script' );
add_action( 'plugins_loaded', function() {
if ( ! defined( 'WC_PLUGIN_FILE' ) ) {
return;
}

add_action( 'admin_enqueue_scripts', 'add_extension_register_script' );

// Load the plugin
require( 'plugin.php' );
});


// Load the plugin
require( 'plugin.php' );

0 comments on commit 915cf54

Please sign in to comment.