add check for woocommerce submenu item array

This commit is contained in:
Ron Rennick 2019-04-29 06:57:33 -03:00
parent 2aaf0ee4b5
commit 4ceb3f3c2d
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ class WC_Admin_Loader {
public static function update_link_structure() {
global $submenu;
// User does not have capabilites to see the submenu.
if ( ! current_user_can( 'manage_woocommerce' ) ) {
if ( ! current_user_can( 'manage_woocommerce' ) || empty( $submenu['woocommerce'] ) ) {
return;
}