}
    /**
     * Perform any version-related changes.
     *
     * @since 1.1.0
     * @param int $installed_version the currently installed version of the plugin
     */
    private function upgrade($installed_version)
    {
        // update the installed version option
        update_option('wc_customizer_version', self::VERSION);
    }
}
/**
 * Returns the One True Instance of Customizer
 *
 * @since 2.3.0
 * @return \WC_Customizer
 */
function wc_customizer()
{
    return WC_Customizer::instance();
}
/**
 * The WC_Customizer global object
 * @deprecated 2.3.0
 * @name $wc_customizer
 * @global WC_Customizer $GLOBALS['wc_customizer']
 */
$GLOBALS['wc_customizer'] = wc_customizer();
    public function save()
    {
        foreach ($this->get_settings() as $field) {
            // skip titles, etc
            if (!isset($field['id'])) {
                continue;
            }
            if (!empty($_POST[$field['id']])) {
                $this->customizations[$field['id']] = wp_kses_post(stripslashes($_POST[$field['id']]));
            } elseif (isset($this->customizations[$field['id']])) {
                unset($this->customizations[$field['id']]);
            }
        }
        update_option('wc_customizer_active_customizations', $this->customizations);
    }
    /**
     * Return admin fields in proper format for outputting / saving
     *
     * @since 1.1
     * @return array
     */
    public function get_settings()
    {
        $settings = array('shop_loop' => array(array('title' => __('Add to Cart Button Text', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'add_to_cart_text', 'title' => __('Simple Product', 'woocommerce-customizer'), 'desc_tip' => __('Changes the add to cart button text for simple products on all loop pages', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'variable_add_to_cart_text', 'title' => __('Variable Product', 'woocommerce-customizer'), 'desc_tip' => __('Changes the add to cart button text for variable products on all loop pages', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'grouped_add_to_cart_text', 'title' => __('Grouped Product', 'woocommerce-customizer'), 'desc_tip' => __('Changes the add to cart button text for grouped products on all loop pages', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'out_of_stock_add_to_cart_text', 'title' => __('Out of Stock Product', 'woocommerce-customizer'), 'desc_tip' => __('Changes the add to cart button text for out of stock products on all loop pages', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend'), array('title' => __('Layout', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'loop_shop_per_page', 'title' => __('Products displayed per page', 'woocommerce-customizer'), 'desc_tip' => __('Changes the number of products displayed per page', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'loop_shop_columns', 'title' => __('Product columns displayed per page', 'woocommerce-customizer'), 'desc_tip' => __('Changes the number of columns displayed per page', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'woocommerce_product_thumbnails_columns', 'title' => __('Product thumbnail columns displayed', 'woocommerce-customizer'), 'desc_tip' => __('Changes the number of product thumbnail columns displayed', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend')), 'product_page' => array(array('title' => __('Tab Titles', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'woocommerce_product_description_tab_title', 'title' => __('Product Description', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Production Description tab title', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'woocommerce_product_additional_information_tab_title', 'title' => __('Additional Information', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Additional Information tab title', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend'), array('title' => __('Tab Content Headings', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'woocommerce_product_description_heading', 'title' => __('Product Description', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Product Description tab heading', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'woocommerce_product_additional_information_heading', 'title' => __('Additional Information', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Additional Information tab heading', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend'), array('title' => __('Add to Cart Button Text', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'single_add_to_cart_text', 'title' => __('All Product Types', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Add to Cart button text on the single product page for all product type', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend')), 'checkout' => array(array('title' => __('Messages', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'woocommerce_checkout_must_be_logged_in_message', 'title' => __('Must be logged in text', 'woocommerce-customizer'), 'desc_tip' => __('Changes the message displayed when a customer must be logged in to checkout', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'woocommerce_checkout_coupon_message', 'title' => __('Coupon text', 'woocommerce-customizer'), 'desc_tip' => __('Changes the message displayed if the coupon form is enabled on checkout', 'woocommerce-customizer'), 'type' => 'text', 'desc' => sprintf('<code>%s ' . esc_attr('<a href="#" class="showcoupon">%s</a>') . '</code>', 'Have a coupon?', 'Click here to enter your code')), array('id' => 'woocommerce_checkout_login_message', 'title' => __('Login text', 'woocommerce-customizer'), 'desc_tip' => __('Changes the message displayed if customers can login at checkout', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend'), array('title' => __('Misc', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'woocommerce_create_account_default_checked', 'title' => __('Create Account checkbox default'), 'desc_tip' => __('Control the default state for the Create Account checkbox', 'woocommerce-customizer'), 'type' => 'select', 'options' => array('customizer_true' => __('Checked', 'woocommerce-customizer'), 'customizer_false' => __('Unchecked', 'woocommerce-customizer')), 'default' => 'customizer_false'), array('id' => 'woocommerce_order_button_text', 'title' => __('Submit Order button', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Place Order button text on checkout', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend')), 'misc' => array(array('title' => __('Tax', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'woocommerce_countries_tax_or_vat', 'title' => __('Tax Label', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Taxes label. Defaults to Tax for USA, VAT for European countries', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'woocommerce_countries_inc_tax_or_vat', 'title' => __('Including Tax Label', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Including Taxes label. Defaults to Inc. tax for USA, Inc. VAT for European countries', 'woocommerce-customizer'), 'type' => 'text'), array('id' => 'woocommerce_countries_ex_tax_or_vat', 'title' => __('Excluding Tax Label', 'woocommerce-customizer'), 'desc_tip' => __('Changes the Excluding Taxes label. Defaults to Exc. tax for USA, Exc. VAT for European countries', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend'), array('title' => __('Images', 'woocommerce-customizer'), 'type' => 'title'), array('id' => 'woocommerce_placeholder_img_src', 'title' => __('Placeholder Image source', 'woocommerce-customizer'), 'desc_tip' => __('Change the default placeholder image by setting this to a valid image URL', 'woocommerce-customizer'), 'type' => 'text'), array('type' => 'sectionend')));
        $current_section = isset($GLOBALS['current_section']) ? $GLOBALS['current_section'] : 'shop_loop';
        return isset($settings[$current_section]) ? $settings[$current_section] : $settings['shop_loop'];
    }
}
// setup settings
return wc_customizer()->settings = new WC_Customizer_Settings();