diff --git a/plugins/woocommerce-beta-tester/changelog/47691-fix-beta-teser-live-branch b/plugins/woocommerce-beta-tester/changelog/47691-fix-beta-teser-live-branch new file mode 100644 index 00000000000..d4323af12d8 --- /dev/null +++ b/plugins/woocommerce-beta-tester/changelog/47691-fix-beta-teser-live-branch @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix "Live Branches" item not shown in the WooCommerce menu \ No newline at end of file diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php index 85b88aaeaf8..bfc63fbd58e 100644 --- a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php +++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php @@ -15,10 +15,6 @@ class WC_Beta_Tester_Live_Branches { * Constructor. */ public function __construct() { - if ( ! $this->woocommerce_is_installed() ) { - return; - } - add_action( 'admin_menu', array( $this, 'register_page' ) ); add_action( 'admin_init', array( $this, 'register_scripts' ) ); } @@ -36,6 +32,10 @@ class WC_Beta_Tester_Live_Branches { * Register live branches scripts. */ public function register_scripts() { + if ( ! $this->woocommerce_is_installed() ) { + return; + } + if ( ! is_admin() ) { return; } @@ -65,6 +65,10 @@ class WC_Beta_Tester_Live_Branches { * Register live branches page. */ public function register_page() { + if ( ! $this->woocommerce_is_installed() ) { + return; + } + if ( ! function_exists( 'wc_admin_register_page' ) ) { return; }