fix: check whether WC_ADMIN_APP is defined before using (#38806)

This commit is contained in:
Leif Singer 2023-06-21 09:14:20 +02:00 committed by GitHub
parent 5b0aa22402
commit bc2cba7b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
check for WC_ADMIN_APP constant before using it

View File

@ -78,6 +78,9 @@ add_action( 'plugins_loaded', '_wc_beta_tester_bootstrap' );
* Register the JS.
*/
function add_extension_register_script() {
if ( ! defined( 'WC_ADMIN_APP' ) ) {
return;
}
$script_path = '/build/index.js';
$script_asset_path = dirname( __FILE__ ) . '/build/index.asset.php';
$script_asset = file_exists( $script_asset_path )