/** * Transfer settings from old option fields to new system based on WC Settings API * * @since 4.4 */ private static function maybe_update_settings() { // Delete deprecated "wootax_shipping_taxable" option if it still exists if (get_option('wootax_shipping_taxable')) { delete_option('wootax_shipping_taxable'); } // Transfer settings so they can be used with WooCommerce settings API $options = array('tc_id', 'tc_key', 'usps_id', 'show_exempt', 'exemption_text', 'company_name', 'show_zero_tax', 'tax_based_on', 'addresses', 'default_address'); foreach ($options as $option) { if (get_option('wootax_' . $option)) { WC_WooTax::set_option($option, get_option('wootax_' . $option)); delete_option('wootax_' . $option); } } // wootax_license_key option was deprecated in 4.5; remove it if (get_option('wootax_license_key')) { delete_option('wootax_license_key'); } }