Merge pull request #36 from woocommerce/update/do-not-initialize-if-wc-is-not-activated

Do not initialize the plugin if WC is not activated
This commit is contained in:
Moon 2022-04-13 03:57:27 -07:00 committed by GitHub
commit 915cf549a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -54,7 +54,15 @@ function add_extension_register_script() {
wp_enqueue_style( 'woocommerce-admin-test-helper' ); 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' );