OptionTree - Version 2.0.4

Version Description

  • Run the 'option_tree' array through validation when upgrading from the 1.0 branch to the 2.0 branch for the first time.
  • Fix a typo in the slider array where textarea's were not saving the first time due to an incorrect array key.
Download this release

Release Info

Developer valendesigns
Plugin Icon wp plugin OptionTree
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

includes/ot-functions-admin.php CHANGED
@@ -366,9 +366,32 @@ if ( ! function_exists( 'ot_default_settings' ) ) {
366
 
367
  }
368
 
369
- /* update the DB */
370
  update_option( 'option_tree_settings', $settings );
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  }
373
 
374
  }
@@ -1600,8 +1623,8 @@ if ( ! function_exists( 'ot_list_item_settings' ) ) {
1600
  'choices' => array()
1601
  ),
1602
  array(
1603
- 'id' => 'caption',
1604
- 'label' => __( 'Caption', 'option-tree' ),
1605
  'desc' => '',
1606
  'std' => '',
1607
  'type' => 'textarea-simple',
@@ -2792,5 +2815,46 @@ if ( ! function_exists( 'ot_array_keys_exists' ) ) {
2792
 
2793
  }
2794
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2795
  /* End of file ot-functions-admin.php */
2796
  /* Location: ./includes/ot-functions-admin.php */
366
 
367
  }
368
 
369
+ /* update the settings array */
370
  update_option( 'option_tree_settings', $settings );
371
 
372
+ /* get option tree array */
373
+ $options = get_option( 'option_tree' );
374
+
375
+ /* validate options */
376
+ if ( is_array( $options ) ) {
377
+
378
+ foreach( $settings['settings'] as $setting ) {
379
+
380
+ if ( isset( $options[$setting['id']] ) ) {
381
+
382
+ $content = ot_stripslashes( $options[$setting['id']] );
383
+
384
+ $options[$setting['id']] = ot_validate_setting( $content, $setting['type'] );
385
+
386
+ }
387
+
388
+ }
389
+
390
+ /* update the option tree array */
391
+ update_option( 'option_tree', $options );
392
+
393
+ }
394
+
395
  }
396
 
397
  }
1623
  'choices' => array()
1624
  ),
1625
  array(
1626
+ 'id' => 'description',
1627
+ 'label' => __( 'Description', 'option-tree' ),
1628
  'desc' => '',
1629
  'std' => '',
1630
  'type' => 'textarea-simple',
2815
 
2816
  }
2817
 
2818
+ /**
2819
+ * Custom stripslashes from single value or array.
2820
+ *
2821
+ * @param mixed $input
2822
+ * @return mixed
2823
+ *
2824
+ * @access public
2825
+ * @since 2.0
2826
+ */
2827
+ if ( ! function_exists( 'ot_stripslashes' ) ) {
2828
+
2829
+ function ot_stripslashes( $input ) {
2830
+
2831
+ if ( is_array( $input ) ) {
2832
+
2833
+ foreach( $input as &$val ) {
2834
+
2835
+ if ( is_array( $val ) ) {
2836
+
2837
+ $val = ot_stripslashes( $val );
2838
+
2839
+ } else {
2840
+
2841
+ $val = stripslashes( trim( $val ) );
2842
+
2843
+ }
2844
+
2845
+ }
2846
+
2847
+ } else {
2848
+
2849
+ $input = stripslashes( trim( $input ) );
2850
+
2851
+ }
2852
+
2853
+ return $input;
2854
+
2855
+ }
2856
+
2857
+ }
2858
+
2859
  /* End of file ot-functions-admin.php */
2860
  /* Location: ./includes/ot-functions-admin.php */
includes/ot-functions-docs-page.php CHANGED
@@ -546,7 +546,7 @@ if ( ! function_exists( 'ot_type_examples' ) ) {
546
  echo \'
547
  <li>
548
  <a href="\' . $slide[\'link\'] . \'"><img src="\' . $slide[\'image\'] . \'" alt="\' . $slide[\'title\'] . \'" /></a>
549
- <div class="description">\' . $slide[\'caption\'] . \'</div>
550
  </li>\';
551
  }
552
  }
546
  echo \'
547
  <li>
548
  <a href="\' . $slide[\'link\'] . \'"><img src="\' . $slide[\'image\'] . \'" alt="\' . $slide[\'title\'] . \'" /></a>
549
+ <div class="description">\' . $slide[\'description\'] . \'</div>
550
  </li>\';
551
  }
552
  }
ot-loader.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: OptionTree
4
  * Plugin URI: http://wp.envato.com
5
  * Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
6
- * Version: 2.0.3
7
  * Author: Derek Herman
8
  * Author URI: http://valendesigns.com
9
  * License: GPLv2
@@ -63,7 +63,7 @@ if ( ! class_exists( 'OT_Loader' ) ) {
63
  /**
64
  * Current Version number.
65
  */
66
- define( 'OT_VERSION', '2.0.3' );
67
 
68
  /**
69
  * For developers: Allow Unfiltered HTML in all the textareas.
3
  * Plugin Name: OptionTree
4
  * Plugin URI: http://wp.envato.com
5
  * Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
6
+ * Version: 2.0.4
7
  * Author: Derek Herman
8
  * Author URI: http://valendesigns.com
9
  * License: GPLv2
63
  /**
64
  * Current Version number.
65
  */
66
+ define( 'OT_VERSION', '2.0.4' );
67
 
68
  /**
69
  * For developers: Allow Unfiltered HTML in all the textareas.
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://bit.ly/NuXI3T
4
  Tags: admin, theme options, meta boxes, options, admin interface, ajax
5
  Requires at least: 3.3
6
  Tested up to: 3.5
7
- Stable tag: 2.0.3
8
  License: GPLv2
9
 
10
  Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
@@ -41,6 +41,10 @@ Yes. OptionTree requires PHP5 to work correctly (so does WP 3.2+).
41
 
42
  == Changelog ==
43
 
 
 
 
 
44
  = 2.0.3 =
45
  * Had an incorrect conditional statement causing an issue where the plugin was attempting to create the 'option-tree' image attachment page, even though it was already created.
46
  * The above also fixed a conflict with 'The Events Calendar' plugin.
@@ -147,7 +151,7 @@ Yes. OptionTree requires PHP5 to work correctly (so does WP 3.2+).
147
 
148
  == Upgrade Notice ==
149
 
150
- = 2.0.1 =
151
  The plugin has undertaken a complete rebuild! If you are not the theme developer, I urge you to contact that person before you upgrade and ask them to test the themes compatibility.
152
 
153
  = 1.1.8.1 =
4
  Tags: admin, theme options, meta boxes, options, admin interface, ajax
5
  Requires at least: 3.3
6
  Tested up to: 3.5
7
+ Stable tag: 2.0.4
8
  License: GPLv2
9
 
10
  Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
41
 
42
  == Changelog ==
43
 
44
+ = 2.0.4 =
45
+ * Run the 'option_tree' array through validation when upgrading from the 1.0 branch to the 2.0 branch for the first time.
46
+ * Fix a typo in the slider array where textarea's were not saving the first time due to an incorrect array key.
47
+
48
  = 2.0.3 =
49
  * Had an incorrect conditional statement causing an issue where the plugin was attempting to create the 'option-tree' image attachment page, even though it was already created.
50
  * The above also fixed a conflict with 'The Events Calendar' plugin.
151
 
152
  == Upgrade Notice ==
153
 
154
+ = 2.0.4 =
155
  The plugin has undertaken a complete rebuild! If you are not the theme developer, I urge you to contact that person before you upgrade and ask them to test the themes compatibility.
156
 
157
  = 1.1.8.1 =