Changeset 855936
- Timestamp:
- 02/11/2014 10:41:14 PM (12 years ago)
- Location:
- woocommerce-customizer/trunk
- Files:
-
- 3 edited
-
includes/class-wc-customizer-admin.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
woocommerce-customizer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-customizer/trunk/includes/class-wc-customizer-admin.php
r762078 r855936 62 62 // Add 'Customizer' link under WooCommerce menu 63 63 add_action( 'admin_menu', array( $this, 'add_menu_link' ) ); 64 65 // save settings 66 add_action( 'admin_init', array( $this, 'save_settings' ) ); 64 67 } 65 68 … … 126 129 ?> </h2> <?php 127 130 128 // save settings129 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 142 131 // display success message 143 132 if ( ! empty( $_GET['saved'] ) ) … … 146 135 // display filters 147 136 $this->render_settings( $this->get_settings( $current_tab ) ); 137 138 ?><input type="hidden" name="wc_customizer_settings" value="1" /><?php 148 139 149 140 submit_button( __( 'Save Customizations', 'wc-customizer' ) ); … … 206 197 public function save_settings( $fields ) { 207 198 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 208 213 $customizations = get_option( 'wc_customizer_active_customizations' ); 209 214 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 ) { 211 218 212 219 if ( ! isset( $field['id'] ) ) … … 221 228 222 229 update_option( 'wc_customizer_active_customizations', $customizations ); 230 231 wp_redirect( add_query_arg( array( 'saved' => 'true' ) ) ); 232 233 exit; 223 234 } 224 235 -
woocommerce-customizer/trunk/readme.txt
r762077 r855936 4 4 Tags: woocommerce 5 5 Requires at least: 3.5 6 Tested up to: 3. 67 Stable tag: 1.1 6 Tested up to: 3.8 7 Stable tag: 1.1.1 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 54 54 == Changelog == 55 55 56 = 1.1.1 = 57 * WooCommerce 2.1 Compatibility 58 56 59 = 1.1 = 57 60 * Refactor to support the upcoming WooCommerce 2.1 beta -
woocommerce-customizer/trunk/woocommerce-customizer.php
r762077 r855936 6 6 * Author: SkyVerge 7 7 * Author URI: http://www.skyverge.com 8 * Version: 1.1 8 * Version: 1.1.1 9 9 * Text Domain: wc-customizer 10 10 * Domain Path: /languages/ … … 71 71 72 72 /** plugin version number */ 73 const VERSION = '1.1 ';73 const VERSION = '1.1.1'; 74 74 75 75 /** var array the active filters */
Note: See TracChangeset
for help on using the changeset viewer.