Fix notice that occurs from external function call
Resolves https://github.com/woothemes/woocommerce/issues/5506. This checks to see if the `integrations` array has any values before getting it's current value.
This commit is contained in:
parent
786d7ed40b
commit
047de95c17
|
@ -44,7 +44,7 @@ class WC_Settings_Integrations extends WC_Settings_Page {
|
|||
|
||||
$integrations = WC()->integrations->get_integrations();
|
||||
|
||||
if ( ! $current_section )
|
||||
if ( ! $current_section && ! empty( $integrations ) )
|
||||
$current_section = current( $integrations )->id;
|
||||
|
||||
foreach ( $integrations as $integration ) {
|
||||
|
@ -71,4 +71,4 @@ class WC_Settings_Integrations extends WC_Settings_Page {
|
|||
|
||||
endif;
|
||||
|
||||
return new WC_Settings_Integrations();
|
||||
return new WC_Settings_Integrations();
|
||||
|
|
Loading…
Reference in New Issue