Fix logic to avoid setting to no again

This commit is contained in:
Gerhard 2019-02-27 14:30:00 +02:00
parent 72ea7b05e7
commit 70f4935236
1 changed files with 7 additions and 6 deletions

View File

@ -576,12 +576,13 @@ class WC_Admin_Setup_Wizard {
update_option( 'woocommerce_price_thousand_sep', $locale_info[ $country ]['thousand_sep'] );
}
}
if ( $tracking && 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) {
update_option( 'woocommerce_allow_tracking', 'yes' );
wp_schedule_single_event( time() + 10, 'woocommerce_tracker_send_event', array( true ) );
} else {
update_option( 'woocommerce_allow_tracking', 'no' );
if ( 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) {
if ( $tracking ) {
update_option( 'woocommerce_allow_tracking', 'yes' );
wp_schedule_single_event( time() + 10, 'woocommerce_tracker_send_event', array( true ) );
} else {
update_option( 'woocommerce_allow_tracking', 'no' );
}
}
WC_Install::create_pages();