Plugin Directory

Changeset 855936


Ignore:
Timestamp:
02/11/2014 10:41:14 PM (12 years ago)
Author:
maxrice
Message:

1.1.1 Version

Location:
woocommerce-customizer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-customizer/trunk/includes/class-wc-customizer-admin.php

    r762078 r855936  
    6262        // Add 'Customizer' link under WooCommerce menu
    6363        add_action( 'admin_menu', array( $this, 'add_menu_link' ) );
     64
     65        // save settings
     66        add_action( 'admin_init', array( $this, 'save_settings' ) );
    6467    }
    6568
     
    126129                ?> </h2> <?php
    127130
    128                 // save settings
    129                 if ( ! empty( $_POST ) ) {
    130 
    131                     if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'wc-customizer-settings' ) )
    132                         wp_die( __( 'Action failed. Please refresh the page and retry.', 'wc-customizer' ) );
    133 
    134 
    135                     $this->save_settings( $this->get_settings( $current_tab ) );
    136 
    137                     wp_redirect( add_query_arg( array( 'saved' => 'true' ) ) );
    138 
    139                     exit;
    140                 }
    141 
    142131                // display success message
    143132                if ( ! empty( $_GET['saved'] ) )
     
    146135                // display filters
    147136                $this->render_settings( $this->get_settings( $current_tab ) );
     137
     138                ?><input type="hidden" name="wc_customizer_settings" value="1" /><?php
    148139
    149140                submit_button( __( 'Save Customizations', 'wc-customizer' ) );
     
    206197    public function save_settings( $fields ) {
    207198
     199        // save settings
     200        if ( ! isset( $_POST['wc_customizer_settings'] ) ) {
     201            return;
     202        }
     203
     204        // permissions check
     205        if ( ! current_user_can( 'manage_woocommerce' ) ) {
     206            return;
     207        }
     208
     209        // security check
     210        if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'wc-customizer-settings' ) )
     211            wp_die( __( 'Action failed. Please refresh the page and retry.', 'wc-customizer' ) );
     212
    208213        $customizations = get_option( 'wc_customizer_active_customizations' );
    209214
    210         foreach ( $fields as $field ) {
     215        $current_tab = ( empty( $_GET['tab'] ) ) ? 'shop_loop' : urldecode( $_GET['tab'] );
     216
     217        foreach ( $this->get_settings( $current_tab ) as $field ) {
    211218
    212219            if ( ! isset( $field['id'] ) )
     
    221228
    222229        update_option( 'wc_customizer_active_customizations', $customizations );
     230
     231        wp_redirect( add_query_arg( array( 'saved' => 'true' ) ) );
     232
     233        exit;
    223234    }
    224235
  • woocommerce-customizer/trunk/readme.txt

    r762077 r855936  
    44Tags: woocommerce
    55Requires at least: 3.5
    6 Tested up to: 3.6
    7 Stable tag: 1.1
     6Tested up to: 3.8
     7Stable tag: 1.1.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5454== Changelog ==
    5555
     56= 1.1.1 =
     57* WooCommerce 2.1 Compatibility
     58
    5659= 1.1 =
    5760* Refactor to support the upcoming WooCommerce 2.1 beta
  • woocommerce-customizer/trunk/woocommerce-customizer.php

    r762077 r855936  
    66 * Author: SkyVerge
    77 * Author URI: http://www.skyverge.com
    8  * Version: 1.1
     8 * Version: 1.1.1
    99 * Text Domain: wc-customizer
    1010 * Domain Path: /languages/
     
    7171
    7272    /** plugin version number */
    73     const VERSION = '1.1';
     73    const VERSION = '1.1.1';
    7474
    7575    /** var array the active filters */
Note: See TracChangeset for help on using the changeset viewer.