Fix warning on WC Pay subscriptions page with unset submenu item (#33339)
* Fix warning on WC Pay subscriptions page with unset submenu item * Add isset check before iterating over submenu in task list
This commit is contained in:
parent
77703fd7f2
commit
eba6df8299
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix a warning caused by an attempt to iterate over a submenu that may not exist on WC Pay subscriptions page.
|
|
@ -499,7 +499,7 @@ class TaskLists {
|
|||
|
||||
$tasks_count = self::setup_tasks_remaining();
|
||||
|
||||
if ( ! $tasks_count ) {
|
||||
if ( ! $tasks_count || ! isset( $submenu['woocommerce'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -231,6 +231,9 @@ class WcPaySubscriptionsPage {
|
|||
$wc_admin_menu = array();
|
||||
$subscriptions_menu_item = null;
|
||||
|
||||
if ( ! isset( $submenu['woocommerce'] ) ) {
|
||||
return;
|
||||
}
|
||||
foreach ( $submenu['woocommerce'] as $key => $menu_item ) {
|
||||
$wc_admin_menu[ $key ] = $menu_item;
|
||||
|
||||
|
|
Loading…
Reference in New Issue