OptionTree - Version 2.1.3

Version Description

  • Hotfix - Loading OptionTree on the 'init' action proved to be wrong, it now loads on 'after_setup_theme'.
  • Hotfix - Layouts were not being imported properly due to using the wrong path variable.
Download this release

Release Info

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

Code changes from version 2.1.2 to 2.1.3

Files changed (3) hide show
  1. includes/ot-functions-compat.php +1 -1
  2. ot-loader.php +73 -38
  3. readme.txt +6 -2
includes/ot-functions-compat.php CHANGED
@@ -131,7 +131,7 @@ if ( ! function_exists( 'compat_ot_import_from_files' ) ) {
131
  /* auto import Layout file */
132
  if ( $has_layout == true && ! get_option( 'option_tree_layouts' ) ) {
133
 
134
- $get_data = wp_remote_get( $data_file );
135
 
136
  if ( is_wp_error( $get_data ) )
137
  return false;
131
  /* auto import Layout file */
132
  if ( $has_layout == true && ! get_option( 'option_tree_layouts' ) ) {
133
 
134
+ $get_data = wp_remote_get( $layout_file );
135
 
136
  if ( is_wp_error( $get_data ) )
137
  return false;
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.1.2
7
  * Author: Derek Herman
8
  * Author URI: http://valendesigns.com
9
  * License: GPLv3
@@ -32,21 +32,85 @@ if ( ! class_exists( 'OT_Loader' ) ) {
32
  */
33
  public function __construct() {
34
 
 
 
 
35
  /* load OptionTree */
36
- add_action('init', array( $this, 'load' ), 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  }
39
 
40
  /**
41
- * Load OptionTree on the 'init' action. Then filters will be availble
42
- * to the theme, and not only when in Theme Mode.
43
  *
44
  * @return void
45
  *
46
  * @access public
47
- * @since @todo
48
  */
49
- public function load() {
50
 
51
  /* setup the constants */
52
  $this->constants();
@@ -61,7 +125,7 @@ if ( ! class_exists( 'OT_Loader' ) ) {
61
  $this->hooks();
62
 
63
  }
64
-
65
  /**
66
  * Constants
67
  *
@@ -78,7 +142,7 @@ if ( ! class_exists( 'OT_Loader' ) ) {
78
  /**
79
  * Current Version number.
80
  */
81
- define( 'OT_VERSION', '2.1.2' );
82
 
83
  /**
84
  * For developers: Allow Unfiltered HTML in all the textareas.
@@ -228,12 +292,6 @@ if ( ! class_exists( 'OT_Loader' ) ) {
228
  define( 'OT_THEME_URL', get_template_directory_uri() );
229
  }
230
 
231
- /**
232
- * Relative path to the languages directory.
233
- *
234
- * @since 2.0.10
235
- */
236
- define( 'OT_LANG_DIR', dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
237
  }
238
 
239
  /**
@@ -320,14 +378,7 @@ if ( ! class_exists( 'OT_Loader' ) ) {
320
  * @since 2.0
321
  */
322
  private function hooks() {
323
-
324
- /* load the text domain */
325
- if ( false == OT_THEME_MODE && false == OT_CHILD_THEME_MODE ) {
326
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
327
- } else {
328
- add_action( 'after_setup_theme', array( $this, 'load_textdomain' ) );
329
- }
330
-
331
  /* load the Meta Box assets */
332
  if ( OT_META_BOXES == true ) {
333
 
@@ -417,22 +468,6 @@ if ( ! class_exists( 'OT_Loader' ) ) {
417
 
418
  }
419
 
420
- /**
421
- * Load the text domain.
422
- *
423
- * @return void
424
- *
425
- * @access private
426
- * @since 2.0
427
- */
428
- public function load_textdomain() {
429
- if ( false == OT_THEME_MODE && false == OT_CHILD_THEME_MODE ) {
430
- load_plugin_textdomain( 'option-tree', false, OT_LANG_DIR . 'plugin' );
431
- } else {
432
- load_theme_textdomain( 'option-tree', OT_LANG_DIR . 'theme-mode' );
433
- }
434
- }
435
-
436
  /**
437
  * Adds the global CSS to fix the menu icon.
438
  */
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.1.3
7
  * Author: Derek Herman
8
  * Author URI: http://valendesigns.com
9
  * License: GPLv3
32
  */
33
  public function __construct() {
34
 
35
+ /* load languages */
36
+ $this->load_languages();
37
+
38
  /* load OptionTree */
39
+ add_action( 'after_setup_theme', array( $this, 'load_option_tree' ), 1 );
40
+
41
+ }
42
+
43
+ /**
44
+ * Load the languages before everything else.
45
+ *
46
+ * @return void
47
+ *
48
+ * @access private
49
+ * @since 2.1.3
50
+ */
51
+ private function load_languages() {
52
+
53
+ /**
54
+ * A quick check to see if we're in plugin mode.
55
+ *
56
+ * @since 2.1.3
57
+ */
58
+ define( 'OT_PLUGIN_MODE', strpos( dirname( __FILE__ ), 'plugins/' . basename( dirname( __FILE__ ) ) ) !== false ? true : false );
59
+
60
+ /**
61
+ * Path to the languages directory.
62
+ *
63
+ * This path will be relative in plugin mode and absolute in theme mode.
64
+ *
65
+ * @since 2.0.10
66
+ */
67
+ define( 'OT_LANG_DIR', dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
+
69
+ /* load the text domain */
70
+ if ( OT_PLUGIN_MODE ) {
71
+
72
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
73
+
74
+ } else {
75
+
76
+ add_action( 'after_setup_theme', array( $this, 'load_textdomain' ) );
77
+
78
+ }
79
+
80
+ }
81
+
82
+ /**
83
+ * Load the text domain.
84
+ *
85
+ * @return void
86
+ *
87
+ * @access private
88
+ * @since 2.0
89
+ */
90
+ public function load_textdomain() {
91
+
92
+ if ( OT_PLUGIN_MODE ) {
93
+
94
+ load_plugin_textdomain( 'option-tree', false, OT_LANG_DIR );
95
+
96
+ } else {
97
+
98
+ load_theme_textdomain( 'option-tree', OT_LANG_DIR . 'theme-mode' );
99
+
100
+ }
101
 
102
  }
103
 
104
  /**
105
+ * Load OptionTree on the 'after_setup_theme' action. Then filters will
106
+ * be availble to the theme, and not only when in Theme Mode.
107
  *
108
  * @return void
109
  *
110
  * @access public
111
+ * @since 2.1.2
112
  */
113
+ public function load_option_tree() {
114
 
115
  /* setup the constants */
116
  $this->constants();
125
  $this->hooks();
126
 
127
  }
128
+
129
  /**
130
  * Constants
131
  *
142
  /**
143
  * Current Version number.
144
  */
145
+ define( 'OT_VERSION', '2.1.3' );
146
 
147
  /**
148
  * For developers: Allow Unfiltered HTML in all the textareas.
292
  define( 'OT_THEME_URL', get_template_directory_uri() );
293
  }
294
 
 
 
 
 
 
 
295
  }
296
 
297
  /**
378
  * @since 2.0
379
  */
380
  private function hooks() {
381
+
 
 
 
 
 
 
 
382
  /* load the Meta Box assets */
383
  if ( OT_META_BOXES == true ) {
384
 
468
 
469
  }
470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  /**
472
  * Adds the global CSS to fix the menu icon.
473
  */
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.5
6
  Tested up to: 3.6
7
- Stable tag: 2.1.2
8
  License: GPLv3
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 & WordPress both require PHP5.
41
 
42
  == Changelog ==
43
 
 
 
 
 
44
  = 2.1.2 =
45
  * Hotfix - Fixed a JS mistake that caused upload in list items and sliders to not open the media uploader until saved first.
46
  * Hotfix - Load OptionTree on the 'init' action, which allows the UI filters to properly function when not in theme mode.
@@ -275,7 +279,7 @@ Yes. OptionTree & WordPress both require PHP5.
275
 
276
  == Upgrade Notice ==
277
 
278
- = 2.1.2 =
279
  If you're not the developer of this theme, please ask them to test compatibility with version 2.1 before upgrading. If you are the developer, I urge you to do the same in a controlled environment.
280
 
281
  = 2.0.16 =
4
  Tags: admin, theme options, meta boxes, options, admin interface, ajax
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
+ Stable tag: 2.1.3
8
  License: GPLv3
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.1.3 =
45
+ * Hotfix - Loading OptionTree on the 'init' action proved to be wrong, it now loads on 'after_setup_theme'.
46
+ * Hotfix - Layouts were not being imported properly due to using the wrong path variable.
47
+
48
  = 2.1.2 =
49
  * Hotfix - Fixed a JS mistake that caused upload in list items and sliders to not open the media uploader until saved first.
50
  * Hotfix - Load OptionTree on the 'init' action, which allows the UI filters to properly function when not in theme mode.
279
 
280
  == Upgrade Notice ==
281
 
282
+ = 2.1.3 =
283
  If you're not the developer of this theme, please ask them to test compatibility with version 2.1 before upgrading. If you are the developer, I urge you to do the same in a controlled environment.
284
 
285
  = 2.0.16 =