Fixed undefined index after running setup wizard two times on fresh install

This commit is contained in:
Claudio Sanches 2018-02-21 18:15:50 -03:00
parent 03a1906706
commit 2f6795a2c8
1 changed files with 1 additions and 1 deletions

View File

@ -1304,7 +1304,7 @@ class WC_Admin_Setup_Wizard {
// Show the user-saved state if it was previously saved. // Show the user-saved state if it was previously saved.
// Otherwise, rely on the item info. // Otherwise, rely on the item info.
if ( is_array( $previously_saved_settings ) ) { if ( is_array( $previously_saved_settings ) ) {
$should_enable_toggle = 'yes' === $previously_saved_settings['enabled']; $should_enable_toggle = isset( $previously_saved_settings['enabled'] ) && 'yes' === $previously_saved_settings['enabled'];
} else { } else {
$should_enable_toggle = isset( $item_info['enabled'] ) && $item_info['enabled']; $should_enable_toggle = isset( $item_info['enabled'] ) && $item_info['enabled'];
} }