OptionTree - Version 2.0.3

Version Description

  • 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.
  • The above also fixed a conflict with 'The Events Calendar' plugin.
Download this release

Release Info

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

Code changes from version 2.0.2 to 2.0.3

Files changed (3) hide show
  1. includes/ot-functions-admin.php +44 -37
  2. ot-loader.php +2 -2
  3. readme.txt +5 -1
includes/ot-functions-admin.php CHANGED
@@ -183,11 +183,15 @@ if ( ! function_exists( 'ot_admin_scripts' ) ) {
183
  * @access public
184
  * @since 2.0
185
  */
186
- function ot_get_media_post_ID() {
187
- global $wpdb;
188
-
189
- return $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE `post_name` = 'media' AND `post_type` = 'option-tree' AND `post_status` = 'private'" );
190
-
 
 
 
 
191
  }
192
 
193
  /**
@@ -200,39 +204,42 @@ function ot_get_media_post_ID() {
200
  * @access public
201
  * @since 2.0
202
  */
203
- function ot_create_media_post() {
204
- global $current_user;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
- register_post_type( 'option-tree', array(
207
- 'labels' => array( 'name' => __( 'Option Tree', 'option-tree' ) ),
208
- 'public' => true,
209
- 'show_ui' => false,
210
- 'capability_type' => 'post',
211
- 'exclude_from_search' => true,
212
- 'hierarchical' => false,
213
- 'rewrite' => false,
214
- 'supports' => array( 'title', 'editor' ),
215
- 'can_export' => true,
216
- 'show_in_nav_menus' => false
217
- ) );
218
-
219
- /* look for custom page */
220
- $post_id = ot_get_media_post_ID();
221
-
222
- /* no post exists */
223
- if ( $post_id > 0 ) {
224
-
225
- /* create post object */
226
- $_p = array();
227
- $_p['post_title'] = 'Media';
228
- $_p['post_status'] = 'private';
229
- $_p['post_type'] = 'option-tree';
230
- $_p['comment_status'] = 'closed';
231
- $_p['ping_status'] = 'closed';
232
-
233
- /* insert the post into the database */
234
- wp_insert_post( $_p );
235
-
236
  }
237
 
238
  }
183
  * @access public
184
  * @since 2.0
185
  */
186
+ if ( ! function_exists( 'ot_get_media_post_ID' ) ) {
187
+
188
+ function ot_get_media_post_ID() {
189
+ global $wpdb;
190
+
191
+ return $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE `post_name` = 'media' AND `post_type` = 'option-tree' AND `post_status` = 'private'" );
192
+
193
+ }
194
+
195
  }
196
 
197
  /**
204
  * @access public
205
  * @since 2.0
206
  */
207
+ if ( ! function_exists( 'ot_create_media_post' ) ) {
208
+
209
+ function ot_create_media_post() {
210
+
211
+ register_post_type( 'option-tree', array(
212
+ 'labels' => array( 'name' => __( 'Option Tree', 'option-tree' ) ),
213
+ 'public' => true,
214
+ 'show_ui' => false,
215
+ 'capability_type' => 'post',
216
+ 'exclude_from_search' => true,
217
+ 'hierarchical' => false,
218
+ 'rewrite' => false,
219
+ 'supports' => array( 'title', 'editor' ),
220
+ 'can_export' => true,
221
+ 'show_in_nav_menus' => false
222
+ ) );
223
+
224
+ /* look for custom page */
225
+ $post_id = ot_get_media_post_ID();
226
+
227
+ /* no post exists */
228
+ if ( $post_id == 0 ) {
229
+
230
+ /* create post object */
231
+ $_p = array();
232
+ $_p['post_title'] = 'Media';
233
+ $_p['post_status'] = 'private';
234
+ $_p['post_type'] = 'option-tree';
235
+ $_p['comment_status'] = 'closed';
236
+ $_p['ping_status'] = 'closed';
237
+
238
+ /* insert the post into the database */
239
+ wp_insert_post( $_p );
240
+
241
+ }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
244
 
245
  }
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.2
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.2' );
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.3
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.3' );
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.2
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.2 =
45
  * Added I18n support, let the translations begin. The option-tree.pot file is inside the languages directory.
46
  * Trim whitespace on imported choices array.
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
 
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.
47
+
48
  = 2.0.2 =
49
  * Added I18n support, let the translations begin. The option-tree.pot file is inside the languages directory.
50
  * Trim whitespace on imported choices array.