Options Framework - Version 0.8

Version Description

  • Saves tab states using local storage
  • Style updates WordPress 3.2 release
  • Added sanitization filter for info (of_sanitize_allowedtags)
Download this release

Release Info

Developer downstairsdev
Plugin Icon wp plugin Options Framework
Version 0.8
Comparing to
See all releases

Code changes from version 0.7 to 0.8

css/admin-style.css CHANGED
@@ -3,266 +3,177 @@
3
  /*-------------------------------------------------------------------------------------------*/
4
 
5
  .updated {
6
- width:770px;
 
7
  }
8
- #of_container {
9
- margin: 10px 0;
10
- width: 785px;
11
  position:relative;
12
  z-index: 0;
 
 
13
  }
14
- #of_container #header {
15
- height: 60px;
16
- background:#dfdfdf url("../../../../wp-admin/images/gray-grad.png") repeat-x left top;
17
- border: 1px solid #ccc;
18
- border-top-left-radius: 6px;
19
- -moz-border-radius-topleft: 6px;
20
- -webkit-border-top-left-radius: 6px;
21
- -webkit-border-top-right-radius: 6px;
22
- border-top-right-radius: 6px;
23
- -moz-border-radius-topright: 6px;
24
- }
25
- #of_container #header .logo {
26
- float: left;
27
- margin:5px 20px;
28
  }
29
- #of_container #header .logo h2 {
30
- font-style:normal;
31
- font-size: 22px;
32
- line-height: 26px;
33
  }
34
- #of_container #main {
35
- background-color: #f1f1f1;
36
- border-left: 1px solid #d8d8d8;
37
- border-right: 1px solid #d8d8d8;
38
- border-bottom: 1px solid #d8d8d8;
39
  }
40
- #of_container #of-nav {
41
- float: left;
42
- position: relative;
43
- z-index: 9999;
44
- width: 160px;
45
- }
46
- #of_container #of-nav li {
47
- margin-bottom:0
48
- }
49
- #of_container #of-nav ul li a:link, #of-nav ul li a:visited {
50
- display: block;
51
- padding: 10px 10px 10px 15px;
52
- font-family: Georgia, Serif;
53
- font-size: 13px;
54
- text-decoration: none;
55
- color: #797979;
56
- border-bottom: 1px solid #d8d8d8;
57
- }
58
- #of_container #of-nav ul li.current a, #of-nav ul li a:hover {
59
- color: #21759b;
60
- background-color: #fff;
61
- }
62
- #of_container #content {
63
- float: left;
64
- min-height: 560px;
65
- width: 595px;
66
- margin-left: -1px;
67
- padding: 0 14px;
68
- background-color: #fff;
69
- border-left: 1px solid #d8d8d8;
70
- }
71
- #of_container #content .section {
72
- margin-bottom: 10px;
73
  }
74
- #of_container #content .section h3.heading {
75
- margin: 10px 0 10px 0;
76
- padding: 7px 0px;
77
- border-bottom: 1px solid #e7e7e7;
78
- }
79
- #of_container #content .section .controls {
80
  float: left;
81
- width: 345px;
82
- margin: 0 15px 0 0;
 
83
  }
84
- #of_container #content .section .explain {
 
85
  float: left;
86
- width: 225px;
87
- padding: 0 10px 0 0;
88
- font-size: 11px;
89
- color: #999999;
90
  }
91
- #of_container #content .section-checkbox .controls {
 
92
  width:25px
93
  }
94
- #of_container #content .section-checkbox .explain {
95
- width:540px
96
  }
97
- #of_container #content .section-color .controls {
 
98
  width:125px
99
  }
100
- #of_container #content .section-color .explain {
101
- width:440px
102
- }
103
- #of_container textarea, #of_container input, #of_container select {
104
- -moz-border-radius-bottomleft:4px;
105
- -moz-border-radius-bottomright:4px;
106
- -moz-border-radius-topleft:4px;
107
- -moz-border-radius-topright:4px;
108
- border-style:solid;
109
- border-width:1px;
110
- }
111
- #of_container .controls input, #of_container .controls select, #of_container .controls textarea {
112
  margin-bottom: 10px;
113
- background-color: #f1f1f1;
114
- border: 1px solid;
115
- border-color: #ccc #e6e6e6 #e6e6e6 #ccc;
116
- width: 340px;
117
- padding: 4px;
118
- font-size: 12px;
119
- }
120
- #of_container .controls select {
121
- padding: 0 0 0 4px;
122
- width: 340px
123
- }
124
- #of_container .controls textarea {
125
- width: 345px;
126
  }
127
- #of_container input[type=text] {
128
- width: 340px;
129
- }
130
- #of_container input.checkbox {
131
- width: 30px;
132
  }
133
- #of_container input.of-radio {
134
  width: 30px;
 
 
135
  }
136
- #of_container .controls .of-color {
137
  float:left;
138
  width: 80px;
139
  margin-left:5px;
 
140
  }
141
- #of_container #content .section-typography .controls {
142
- width:425px
143
- }
144
- #of_container #content .section-typography .explain {
145
- width:140px
146
- }
147
- #of_container .controls .of-typography-size {
148
  width:80px;
 
149
  float:left
150
  }
151
- #of_container .controls .of-typography-unit {
152
  width:50px;
 
153
  float:left
154
  }
155
- #of_container .controls .of-typography-face {
156
  width:100px;
 
157
  float:left
158
  }
159
- #of_container .controls .of-typography-style {
160
  width:80px;
 
 
161
  float:left
162
  }
163
- #of_container #content .section-background .controls {
164
- width:425px
165
- }
166
- #of_container #content .section-background .explain {
167
- width:140px
168
- }
169
- #of_container .of-background-properties {
170
  margin-top: 18px;
171
  }
172
- #of_container .controls .of-background-repeat {
173
- width:160px;
 
174
  float:left
175
  }
176
- #of_container .controls .of-background-position {
177
  width:125px;
 
178
  float:left
179
  }
180
- #of_container .controls .of-background-attachment {
181
  width:125px;
 
182
  float:left
183
  }
184
- #of_container div.section-background .controls input.upload {
185
- width: 240px;
186
  }
187
- #of_container .controls .of-radio-img-img {
188
- border:3px solid #fff;
189
  margin:0 5px 10px 0;
190
  display:none;
191
  cursor:pointer;
192
  float:left;
193
  }
194
- #of_container .controls .of-radio-img-selected {
195
  border:3px solid #ccc
196
  }
197
- #of_container .controls .of-radio-img-img:hover {
198
  opacity:.8;
199
  }
200
- #of_container .controls .of-border-width {
201
  width:80px;
202
  float:left
203
  }
204
- #of_container .controls .of-border-style {
205
  width:120px;
206
  float:left
207
  }
208
- #of_container .group {
209
- padding-bottom:20px
210
- }
211
- #of_container .group h2 {
212
- display:none;
213
- border-bottom:3px solid #e7e7e7
214
- }
215
- #of_container .controls input:focus, #of_container select:focus, #of_container textarea:focus {
216
- background:#fff;
217
- }
218
- #of_container .hide {
219
  display:none;
220
  }
221
- #of_container .of-option-image {
222
  max-width:340px;
223
  margin:3px 0 18px 0;
224
  }
225
- #of_container .mini .controls select, #of_container #content .section .mini .controls {
226
- width: 70px;
227
  }
228
- #of_container .mini .controls input, #of_container #content .mini .controls {
229
- width: 70px;
 
230
  }
231
- #of_container #content .mini .explain {
232
- width:500px;
233
  }
234
-
235
  /* Image Uploader */
236
 
237
- #of_container .controls input.upload {
238
- width:280px;
239
- padding-bottom:6px;
240
  }
241
- #of_container .controls input.upload_button {
242
  float:right;
243
  width:45px;
244
  border-color:#BBBBBB;
245
  cursor:pointer;
246
  height:16px;
247
  }
248
- #of_container .controls input.upload_button:hover {
249
  border-color:#666666;
250
  color:#000;
251
  }
252
- #of_container .screenshot {
253
  float:left;
254
  margin-left:1px;
255
  position:relative;
256
  width:344px;
257
  margin-top:3px;
258
  }
259
- #of_container .section-background .screenshot {
260
- margin-bottom:18px;
261
- }
262
- #of_container .screenshot img {
263
- -moz-border-radius:4px;
264
- -webkit-border-radius:4px;
265
- -border-radius:4px;
266
  background:#FAFAFA;
267
  border-color:#ccc #eee #eee #ccc;
268
  border-style:solid;
@@ -270,11 +181,12 @@
270
  float:left;
271
  max-width:334px;
272
  padding:4px;
 
273
  }
274
- #of_container .screenshot .mlu_remove {
275
  background:url("../images/ico-delete.png") no-repeat;
276
  border:medium none;
277
- bottom:-4px;
278
  display:block;
279
  float:left;
280
  height:16px;
@@ -284,33 +196,25 @@
284
  text-indent:-9999px;
285
  width:16px;
286
  }
287
- #of_container .screenshot .no_image .file_link {
288
  margin-left: 20px;
289
  }
290
- #of_container .screenshot .no_image .mlu_remove {
291
  bottom: 0px;
292
  }
293
- #of_container .reset-button {
294
  float:left;
295
  cursor:pointer;
296
  }
297
 
298
  /* Bottom Section */
299
 
300
- #of_container .button-primary {
301
- float:right;
 
 
 
302
  }
303
- #of_container .of_admin_bar {
304
- background: #f3f3f3;
305
- border:solid #ccc;
306
- border-width:0px 1px 1px 1px;
307
- padding: 10px 20px 0px 20px;
308
- height: 35px;
309
- text-align: right;
310
- -moz-border-radius-bottomright: 6px;
311
- -moz-border-radius-bottomleft: 6px;
312
- -webkit-border-bottom-right-radius: 6px;
313
- -webkit-border-bottom-left-radius: 6px;
314
- border-bottom-right-radius: 6px;
315
- border-bottom-left-radius: 6px;
316
  }
3
  /*-------------------------------------------------------------------------------------------*/
4
 
5
  .updated {
6
+ max-width:764px;
7
+ margin-bottom:0px !important;
8
  }
9
+ #optionsframework {
 
 
10
  position:relative;
11
  z-index: 0;
12
+ max-width:780px;
13
+ background:#fff;
14
  }
15
+ #optionsframework p {
16
+ margin-bottom:0;
17
+ padding-bottom:10px;
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
+ #optionsframework .section {
20
+ padding:10px 10px 0;
 
 
21
  }
22
+ #optionsframework .group .section:last-of-type {
23
+ padding-bottom:40px;
 
 
 
24
  }
25
+ #optionsframework .section .heading {
26
+ padding:10px 0px;
27
+ margin:0 0 15px;
28
+ border-bottom: 1px solid #dfdfdf;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
+ #optionsframework .section .controls {
 
 
 
 
 
31
  float: left;
32
+ min-width:350px;
33
+ width: 54%;
34
+ padding-right:2%;
35
  }
36
+ #optionsframework .section .explain {
37
+ max-width:38%;
38
  float: left;
39
+ font-size: 12px;
40
+ line-height:16px;
41
+ color: #777;
 
42
  }
43
+ #optionsframework .section-checkbox .controls {
44
+ min-width:25px;
45
  width:25px
46
  }
47
+ #optionsframework .section-checkbox .explain {
48
+ max-width:93%;
49
  }
50
+ #optionsframework .section-color .controls {
51
+ min-width:125px;
52
  width:125px
53
  }
54
+ #optionsframework .controls input, #optionsframework .controls select, #optionsframework .controls textarea {
 
 
 
 
 
 
 
 
 
 
 
55
  margin-bottom: 10px;
56
+ width:100%;
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
+ #optionsframework .section-radio label, #optionsframework .section-multicheck label {
59
+ float:left;
 
 
 
60
  }
61
+ #optionsframework input.checkbox, #optionsframework input.of-radio {
62
  width: 30px;
63
+ float:left;
64
+ clear:both;
65
  }
66
+ #optionsframework .controls .of-color {
67
  float:left;
68
  width: 80px;
69
  margin-left:5px;
70
+ margin-right:5px;
71
  }
72
+ #optionsframework .controls .of-typography-size {
 
 
 
 
 
 
73
  width:80px;
74
+ margin-left:5px;
75
  float:left
76
  }
77
+ #optionsframework .controls .of-typography-unit {
78
  width:50px;
79
+ margin-left:5px;
80
  float:left
81
  }
82
+ #optionsframework .controls .of-typography-face {
83
  width:100px;
84
+ margin-left:5px;
85
  float:left
86
  }
87
+ #optionsframework .controls .of-typography-style {
88
  width:80px;
89
+ margin-left:5px;
90
+ margin-right:5px;
91
  float:left
92
  }
93
+ #optionsframework .of-background-properties {
94
+ clear:both;
 
 
 
 
 
95
  margin-top: 18px;
96
  }
97
+ #optionsframework .controls .of-background-repeat {
98
+ width:125px;
99
+ margin-right:5px;
100
  float:left
101
  }
102
+ #optionsframework .controls .of-background-position {
103
  width:125px;
104
+ margin-right:5px;
105
  float:left
106
  }
107
+ #optionsframework .controls .of-background-attachment {
108
  width:125px;
109
+ margin-right:5px;
110
  float:left
111
  }
112
+ #optionsframework div.section-background .controls input.upload {
113
+ width:47%;
114
  }
115
+ #optionsframework .controls .of-radio-img-img {
116
+ border:3px solid #f9f9f9;
117
  margin:0 5px 10px 0;
118
  display:none;
119
  cursor:pointer;
120
  float:left;
121
  }
122
+ #optionsframework .controls .of-radio-img-selected {
123
  border:3px solid #ccc
124
  }
125
+ #optionsframework .controls .of-radio-img-img:hover {
126
  opacity:.8;
127
  }
128
+ #optionsframework .controls .of-border-width {
129
  width:80px;
130
  float:left
131
  }
132
+ #optionsframework .controls .of-border-style {
133
  width:120px;
134
  float:left
135
  }
136
+ #optionsframework .hide {
 
 
 
 
 
 
 
 
 
 
137
  display:none;
138
  }
139
+ #optionsframework .of-option-image {
140
  max-width:340px;
141
  margin:3px 0 18px 0;
142
  }
143
+ #optionsframework .mini .controls select, #optionsframework .section .mini .controls {
144
+ width: 140px;
145
  }
146
+ #optionsframework .mini .controls input, #optionsframework .mini .controls {
147
+ min-width:140px;
148
+ width: 140px;
149
  }
150
+ #optionsframework .mini .explain {
151
+ max-width:74%;
152
  }
 
153
  /* Image Uploader */
154
 
155
+ #optionsframework .controls input.upload {
156
+ width:80%;
 
157
  }
158
+ #optionsframework .controls input.upload_button {
159
  float:right;
160
  width:45px;
161
  border-color:#BBBBBB;
162
  cursor:pointer;
163
  height:16px;
164
  }
165
+ #optionsframework .controls input.upload_button:hover {
166
  border-color:#666666;
167
  color:#000;
168
  }
169
+ #optionsframework .screenshot {
170
  float:left;
171
  margin-left:1px;
172
  position:relative;
173
  width:344px;
174
  margin-top:3px;
175
  }
176
+ #optionsframework .screenshot img {
 
 
 
 
 
 
177
  background:#FAFAFA;
178
  border-color:#ccc #eee #eee #ccc;
179
  border-style:solid;
181
  float:left;
182
  max-width:334px;
183
  padding:4px;
184
+ margin-bottom:10px;
185
  }
186
+ #optionsframework .screenshot .mlu_remove {
187
  background:url("../images/ico-delete.png") no-repeat;
188
  border:medium none;
189
+ bottom:4px;
190
  display:block;
191
  float:left;
192
  height:16px;
196
  text-indent:-9999px;
197
  width:16px;
198
  }
199
+ #optionsframework .screenshot .no_image .file_link {
200
  margin-left: 20px;
201
  }
202
+ #optionsframework .screenshot .no_image .mlu_remove {
203
  bottom: 0px;
204
  }
205
+ #optionsframework .reset-button {
206
  float:left;
207
  cursor:pointer;
208
  }
209
 
210
  /* Bottom Section */
211
 
212
+ #optionsframework-submit {
213
+ padding: 7px 10px;
214
+ border-top: 1px solid #ECECEC;
215
+ background-color: #F1F1F1;
216
+ background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC);
217
  }
218
+ #optionsframework .button-primary {
219
+ float:right;
 
 
 
 
 
 
 
 
 
 
 
220
  }
js/options-custom.js CHANGED
@@ -31,7 +31,15 @@ jQuery(document).ready(function($) {
31
 
32
  // Switches option sections
33
  $('.group').hide();
34
- $('.group:first').fadeIn();
 
 
 
 
 
 
 
 
35
  $('.group .collapsed').each(function(){
36
  $(this).find('input:checked').parent().parent().parent().nextAll().each(
37
  function(){
@@ -42,6 +50,24 @@ jQuery(document).ready(function($) {
42
  $(this).filter('.hidden').removeClass('hidden');
43
  });
44
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  $('.group .collapsed input:checkbox').click(unhideHidden);
47
 
@@ -71,14 +97,5 @@ jQuery(document).ready(function($) {
71
  $('.of-radio-img-label').hide();
72
  $('.of-radio-img-img').show();
73
  $('.of-radio-img-radio').hide();
74
-
75
- $('#of-nav li:first').addClass('current');
76
- $('#of-nav li a').click(function(evt) {
77
- $('#of-nav li').removeClass('current');
78
- $(this).parent().addClass('current');
79
- var clicked_group = $(this).attr('href');
80
- $('.group').hide();
81
- $(clicked_group).fadeIn();
82
- evt.preventDefault();
83
- });
84
  });
31
 
32
  // Switches option sections
33
  $('.group').hide();
34
+ var activetab = '';
35
+ if (typeof(localStorage) != 'undefined' ) {
36
+ activetab = localStorage.getItem("activetab");
37
+ }
38
+ if (activetab != '' && $(activetab).length ) {
39
+ $(activetab).fadeIn();
40
+ } else {
41
+ $('.group:first').fadeIn();
42
+ }
43
  $('.group .collapsed').each(function(){
44
  $(this).find('input:checked').parent().parent().parent().nextAll().each(
45
  function(){
50
  $(this).filter('.hidden').removeClass('hidden');
51
  });
52
  });
53
+
54
+ if (activetab != '' && $(activetab + '-tab').length ) {
55
+ $(activetab + '-tab').addClass('nav-tab-active');
56
+ }
57
+ else {
58
+ $('.nav-tab-wrapper a:first').addClass('nav-tab-active');
59
+ }
60
+ $('.nav-tab-wrapper a').click(function(evt) {
61
+ $('.nav-tab-wrapper a').removeClass('nav-tab-active');
62
+ $(this).addClass('nav-tab-active').blur();
63
+ var clicked_group = $(this).attr('href');
64
+ if (typeof(localStorage) != 'undefined' ) {
65
+ localStorage.setItem("activetab", $(this).attr('href'));
66
+ }
67
+ $('.group').hide();
68
+ $(clicked_group).fadeIn();
69
+ evt.preventDefault();
70
+ });
71
 
72
  $('.group .collapsed input:checkbox').click(unhideHidden);
73
 
97
  $('.of-radio-img-label').hide();
98
  $('.of-radio-img-img').show();
99
  $('.of-radio-img-radio').hide();
100
+
 
 
 
 
 
 
 
 
 
101
  });
options-framework.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Options Framework
4
  Plugin URI: http://www.wptheming.com
5
  Description: A framework for building theme options.
6
- Version: 0.7
7
  Author: Devin Price
8
  Author URI: http://www.wptheming.com
9
  License: GPLv2
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
 
28
  /* Basic plugin definitions */
29
 
30
- define('OPTIONS_FRAMEWORK_VERSION', '0.7');
31
  define('OPTIONS_FRAMEWORK_URL', plugin_dir_url( __FILE__ ));
32
 
33
  /* Make sure we don't expose any info if called directly */
@@ -76,6 +76,14 @@ function optionsframework_delete_options() {
76
  delete_option('optionsframework');
77
  }
78
 
 
 
 
 
 
 
 
 
79
  /*
80
  * Creates the settings in the database by looping through the array
81
  * we supplied in options.php. This is a neat way to do it since
@@ -89,7 +97,6 @@ function optionsframework_delete_options() {
89
  function optionsframework_init() {
90
 
91
  // Include the required files
92
- require_once dirname( __FILE__ ) . '/options-sanitize.php';
93
  require_once dirname( __FILE__ ) . '/options-interface.php';
94
  require_once dirname( __FILE__ ) . '/options-medialibrary-uploader.php';
95
 
@@ -226,47 +233,31 @@ function of_admin_head() {
226
 
227
  if ( !function_exists( 'optionsframework_page' ) ) {
228
  function optionsframework_page() {
229
-
230
- // Get the theme name so we can display it up top
231
- $themename = get_theme_data(STYLESHEETPATH . '/style.css');
232
- $themename = $themename['Name'];
233
-
234
  settings_errors();
235
  ?>
236
 
237
  <div class="wrap">
238
  <?php screen_icon( 'themes' ); ?>
239
- <h2><?php esc_html_e( 'Theme Options' ); ?></h2>
 
 
240
 
241
- <div id="of_container">
242
- <form action="options.php" method="post">
243
- <?php settings_fields('optionsframework'); ?>
244
-
245
- <div id="header">
246
- <div class="logo">
247
- <h2><?php esc_html_e( $themename ); ?></h2>
248
- </div>
249
- <div class="clear"></div>
250
- </div>
251
- <div id="main">
252
- <?php $return = optionsframework_fields(); ?>
253
- <div id="of-nav">
254
- <ul>
255
- <?php echo $return[1]; ?>
256
- </ul>
257
- </div>
258
- <div id="content">
259
- <?php echo $return[0]; /* Settings */ ?>
260
- </div>
261
- <div class="clear"></div>
262
- </div>
263
- <div class="of_admin_bar">
264
  <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options' ); ?>" />
265
  <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!' ) ); ?>' );" />
 
266
  </div>
267
- <div class="clear"></div>
268
  </form>
269
- </div> <!-- / #container -->
 
270
  </div> <!-- / .wrap -->
271
 
272
  <?php
3
  Plugin Name: Options Framework
4
  Plugin URI: http://www.wptheming.com
5
  Description: A framework for building theme options.
6
+ Version: 0.8
7
  Author: Devin Price
8
  Author URI: http://www.wptheming.com
9
  License: GPLv2
27
 
28
  /* Basic plugin definitions */
29
 
30
+ define('OPTIONS_FRAMEWORK_VERSION', '0.8');
31
  define('OPTIONS_FRAMEWORK_URL', plugin_dir_url( __FILE__ ));
32
 
33
  /* Make sure we don't expose any info if called directly */
76
  delete_option('optionsframework');
77
  }
78
 
79
+ /* Loads the file for option sanitization */
80
+
81
+ add_action('init', 'optionsframework_load_sanitization' );
82
+
83
+ function optionsframework_load_sanitization() {
84
+ require_once dirname( __FILE__ ) . '/options-sanitize.php';
85
+ }
86
+
87
  /*
88
  * Creates the settings in the database by looping through the array
89
  * we supplied in options.php. This is a neat way to do it since
97
  function optionsframework_init() {
98
 
99
  // Include the required files
 
100
  require_once dirname( __FILE__ ) . '/options-interface.php';
101
  require_once dirname( __FILE__ ) . '/options-medialibrary-uploader.php';
102
 
233
 
234
  if ( !function_exists( 'optionsframework_page' ) ) {
235
  function optionsframework_page() {
236
+ $return = optionsframework_fields();
 
 
 
 
237
  settings_errors();
238
  ?>
239
 
240
  <div class="wrap">
241
  <?php screen_icon( 'themes' ); ?>
242
+ <h2 class="nav-tab-wrapper">
243
+ <?php echo $return[1]; ?>
244
+ </h2>
245
 
246
+ <div class="metabox-holder">
247
+ <div id="optionsframework" class="postbox">
248
+ <form action="options.php" method="post">
249
+ <?php settings_fields('optionsframework'); ?>
250
+
251
+ <?php echo $return[0]; /* Settings */ ?>
252
+
253
+ <div id="optionsframework-submit">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options' ); ?>" />
255
  <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!' ) ); ?>' );" />
256
+ <div class="clear"></div>
257
  </div>
 
258
  </form>
259
+ </div> <!-- / #container -->
260
+ </div>
261
  </div> <!-- / .wrap -->
262
 
263
  <?php
options-interface.php CHANGED
@@ -8,6 +8,10 @@ function optionsframework_fields() {
8
 
9
  global $allowedtags;
10
  $optionsframework_settings = get_option('optionsframework');
 
 
 
 
11
 
12
  // Gets the unique option id
13
  if (isset($optionsframework_settings['id'])) {
@@ -48,7 +52,7 @@ function optionsframework_fields() {
48
  }
49
 
50
  $output .= '<div id="' . esc_attr( $id ) .'" class="' . esc_attr( $class ) . '">'."\n";
51
- $output .= '<h3 class="heading">' . esc_html( $value['name'] ) . '</h3>' . "\n";
52
  $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
53
  }
54
 
@@ -112,7 +116,7 @@ function optionsframework_fields() {
112
  $name = $option_name .'['. $value['id'] .']';
113
  foreach ($value['options'] as $key => $option) {
114
  $id = $option_name . '-' . $value['id'] .'-'. $key;
115
- $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label><br />';
116
  }
117
  break;
118
 
@@ -153,7 +157,7 @@ function optionsframework_fields() {
153
  $checked = checked($val[$option], 1, false);
154
  }
155
 
156
- $output .= '<input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label><br />';
157
  }
158
  break;
159
 
@@ -270,10 +274,10 @@ function optionsframework_fields() {
270
 
271
  $output .= '<div class="' . esc_attr( $class ) . '">' . "\n";
272
  if ( isset($value['name']) ) {
273
- $output .= '<h3 class="heading">' . esc_html( $value['name'] ) . '</h3>' . "\n";
274
  }
275
  if ( $value['desc'] ) {
276
- $output .= wpautop( wp_kses( $value['desc'], $allowedtags) ) . "\n";
277
  }
278
  $output .= '<div class="clear"></div></div>' . "\n";
279
  break;
@@ -285,8 +289,9 @@ function optionsframework_fields() {
285
  }
286
  $jquery_click_hook = preg_replace('/\W/', '', strtolower($value['name']) );
287
  $jquery_click_hook = "of-option-" . $jquery_click_hook;
288
- $menu .= '<li><a title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a></li>';
289
- $output .= '<div class="group" id="' . esc_attr( $jquery_click_hook ) . '"><h2>' . esc_html( $value['name'] ) . '</h2>' . "\n";
 
290
  break;
291
  }
292
 
8
 
9
  global $allowedtags;
10
  $optionsframework_settings = get_option('optionsframework');
11
+
12
+ // Get the theme name so we can display it up top
13
+ $themename = get_theme_data(STYLESHEETPATH . '/style.css');
14
+ $themename = $themename['Name'];
15
 
16
  // Gets the unique option id
17
  if (isset($optionsframework_settings['id'])) {
52
  }
53
 
54
  $output .= '<div id="' . esc_attr( $id ) .'" class="' . esc_attr( $class ) . '">'."\n";
55
+ $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
56
  $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
57
  }
58
 
116
  $name = $option_name .'['. $value['id'] .']';
117
  foreach ($value['options'] as $key => $option) {
118
  $id = $option_name . '-' . $value['id'] .'-'. $key;
119
+ $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label>';
120
  }
121
  break;
122
 
157
  $checked = checked($val[$option], 1, false);
158
  }
159
 
160
+ $output .= '<input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label>';
161
  }
162
  break;
163
 
274
 
275
  $output .= '<div class="' . esc_attr( $class ) . '">' . "\n";
276
  if ( isset($value['name']) ) {
277
+ $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
278
  }
279
  if ( $value['desc'] ) {
280
+ $output .= apply_filters('of_sanitize_info', $value['desc'] ) . "\n";
281
  }
282
  $output .= '<div class="clear"></div></div>' . "\n";
283
  break;
289
  }
290
  $jquery_click_hook = preg_replace('/\W/', '', strtolower($value['name']) );
291
  $jquery_click_hook = "of-option-" . $jquery_click_hook;
292
+ $menu .= '<a id="'. esc_attr( $jquery_click_hook ) . '-tab" class="nav-tab" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a>';
293
+ $output .= '<div class="group" id="' . esc_attr( $jquery_click_hook ) . '">';
294
+ $output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . "\n";
295
  break;
296
  }
297
 
options-sanitize.php CHANGED
@@ -14,6 +14,16 @@ function of_sanitize_textarea($input) {
14
 
15
  add_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
16
 
 
 
 
 
 
 
 
 
 
 
17
  /* Select */
18
 
19
  add_filter( 'of_sanitize_select', 'of_sanitize_enum', 10, 2);
14
 
15
  add_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
16
 
17
+ /* Info */
18
+
19
+ function of_sanitize_allowedtags($input) {
20
+ global $allowedtags;
21
+ $output = wpautop(wp_kses( $input, $allowedtags));
22
+ return $output;
23
+ }
24
+
25
+ add_filter( 'of_sanitize_info', 'of_sanitize_allowedtags' );
26
+
27
  /* Select */
28
 
29
  add_filter( 'of_sanitize_select', 'of_sanitize_enum', 10, 2);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Devin Price
3
  Tags: options, theme options
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X238BDP4QGTV2
5
  Requires at least: 3.0
6
- Tested up to: 3.1
7
- Stable tag: 0.7
8
  License: GPLv2
9
 
10
  == Description ==
@@ -13,7 +13,7 @@ The Options Framework Plugin makes it easy to include an options panel in any Wo
13
 
14
  Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
15
 
16
- The code is heavily based on the [WooFramework](http://www.woothemes.com/) and their option styles.
17
 
18
  == Installation ==
19
 
@@ -51,6 +51,12 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
54
  = 0.7 =
55
 
56
  * Added filtering for recognized arrays (like Font Face)
3
  Tags: options, theme options
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X238BDP4QGTV2
5
  Requires at least: 3.0
6
+ Tested up to: 3.2
7
+ Stable tag: 0.8
8
  License: GPLv2
9
 
10
  == Description ==
13
 
14
  Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
15
 
16
+ The code was originally based on the [WooFramework](http://www.woothemes.com/) and their option styles.
17
 
18
  == Installation ==
19
 
51
 
52
  == Changelog ==
53
 
54
+ = 0.8 =
55
+
56
+ * Saves tab states using local storage
57
+ * Style updates WordPress 3.2 release
58
+ * Added sanitization filter for info (of_sanitize_allowedtags)
59
+
60
  = 0.7 =
61
 
62
  * Added filtering for recognized arrays (like Font Face)
screenshot-1.png CHANGED
Binary file