Fix "Live Branches" item not shown in the WooCommerce menu (#47691)
* Fix live branch menu not show up * Add changefile(s) from automation for the following project(s): woocommerce-beta-tester --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
313ab0eb74
commit
90432c612e
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix "Live Branches" item not shown in the WooCommerce menu
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue