Options Framework - Version 1.2

Version Description

  • Fix for font_size santization
  • Added internationalization support (@weslly)
  • Portuguese translations (@weslly)
  • Spanish translations (@sksmatt)
  • Make uploader post type non-public (@samargulies)
  • ID can now be passed on info option for styling purposes
Download this release

Release Info

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

Code changes from version 1.1 to 1.2

css/{admin-style.css → optionsframework.css} RENAMED
@@ -1,5 +1,5 @@
1
  /*-------------------------------------------------------------------------------------------*/
2
- /* OptionsFramework Admin Styles */
3
  /*-------------------------------------------------------------------------------------------*/
4
 
5
  .updated {
1
  /*-------------------------------------------------------------------------------------------*/
2
+ /* Options Framework Admin Styles */
3
  /*-------------------------------------------------------------------------------------------*/
4
 
5
  .updated {
lang/optionsframework-es_ES.mo ADDED
Binary file
lang/optionsframework-es_ES.po ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Options Framework Plugin\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-22 19:13-0300\n"
6
+ "PO-Revision-Date: 2012-04-22 19:17-0300\n"
7
+ "Last-Translator: Matt Varone <plugins@mattvarone.com>\n"
8
+ "Language-Team: Matt Varone <contact@mattvarone.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;_x;__;esc_attr_e\n"
13
+ "X-Poedit-Basepath: ../\n"
14
+ "X-Poedit-Language: Spanish\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: options-framework.php:71
18
+ #, php-format
19
+ msgid "Your current theme does not have support for the Options Framework plugin. <a href=\"%1$s\" target=\"_blank\">Learn More</a> | <a href=\"%2$s\">Hide Notice</a>"
20
+ msgstr "Su tema actual no tiene suporte para el Options Framework Plugin. <a href=\"%1$s\" target=\"_blank\">Mas informacion</a> | <a href=\"%2$s\">Esconder</a>"
21
+
22
+ #: options-framework.php:254
23
+ #: options-framework.php:456
24
+ msgid "Theme Options"
25
+ msgstr "Opciones del Tema"
26
+
27
+ #: options-framework.php:323
28
+ msgid "Save Options"
29
+ msgstr "Guardar Opciones"
30
+
31
+ #: options-framework.php:324
32
+ msgid "Restore Defaults"
33
+ msgstr "Restaurar Ajustes"
34
+
35
+ #: options-framework.php:324
36
+ msgid "Click OK to reset. Any theme settings will be lost!"
37
+ msgstr "Click OK para restablecer los ajustes iniciales. Se perderán los ajustes realizados!"
38
+
39
+ #: options-framework.php:358
40
+ msgid "Default options restored."
41
+ msgstr "Opciones predeterminadas restauradas."
42
+
43
+ #: options-framework.php:400
44
+ msgid "Options saved."
45
+ msgstr "Opciones Guardadas."
46
+
47
+ #: options-medialibrary-uploader.php:26
48
+ msgid "Options Framework Internal Container"
49
+ msgstr "Contenedor Interno de Options Framework"
50
+
51
+ #: options-medialibrary-uploader.php:128
52
+ msgid "Upload"
53
+ msgstr "Cargar"
54
+
55
+ #: options-medialibrary-uploader.php:151
56
+ msgid "View File"
57
+ msgstr "Ver Archivo"
58
+
59
+ #: options-medialibrary-uploader.php:288
60
+ msgid "Gallery"
61
+ msgstr "Galería"
62
+
63
+ #: options-medialibrary-uploader.php:288
64
+ msgid "Previously Uploaded"
65
+ msgstr "Cargado Previamente"
66
+
67
+ #: options-sanitize.php:232
68
+ msgid "No Repeat"
69
+ msgstr "No Repetir"
70
+
71
+ #: options-sanitize.php:233
72
+ msgid "Repeat Horizontally"
73
+ msgstr "Repetir Horizontalmente"
74
+
75
+ #: options-sanitize.php:234
76
+ msgid "Repeat Vertically"
77
+ msgstr "Repetir Verticalmente"
78
+
79
+ #: options-sanitize.php:235
80
+ msgid "Repeat All"
81
+ msgstr "Repetir Todos"
82
+
83
+ #: options-sanitize.php:248
84
+ msgid "Top Left"
85
+ msgstr "Arriba a la Izquierda"
86
+
87
+ #: options-sanitize.php:249
88
+ msgid "Top Center"
89
+ msgstr "Arriba al Centro"
90
+
91
+ #: options-sanitize.php:250
92
+ msgid "Top Right"
93
+ msgstr "Arriba a la Derecha"
94
+
95
+ #: options-sanitize.php:251
96
+ msgid "Middle Left"
97
+ msgstr "Medio a la Izquierda"
98
+
99
+ #: options-sanitize.php:252
100
+ msgid "Middle Center"
101
+ msgstr "Medio al Centro"
102
+
103
+ #: options-sanitize.php:253
104
+ msgid "Middle Right"
105
+ msgstr "Medio a la Derecha"
106
+
107
+ #: options-sanitize.php:254
108
+ msgid "Bottom Left"
109
+ msgstr "Abajo a la Izquierda"
110
+
111
+ #: options-sanitize.php:255
112
+ msgid "Bottom Center"
113
+ msgstr "Abajo al Centro"
114
+
115
+ #: options-sanitize.php:256
116
+ msgid "Bottom Right"
117
+ msgstr "Abajo a la Derecha"
118
+
119
+ #: options-sanitize.php:269
120
+ msgid "Scroll Normally"
121
+ msgstr "Desplazar Normalmente"
122
+
123
+ #: options-sanitize.php:270
124
+ msgid "Fixed in Place"
125
+ msgstr "Fijo en el Lugar"
126
+
127
+ #: options-sanitize.php:344
128
+ msgid "Normal"
129
+ msgstr "Normal"
130
+
131
+ #: options-sanitize.php:345
132
+ msgid "Italic"
133
+ msgstr "Cursiva"
134
+
135
+ #: options-sanitize.php:346
136
+ msgid "Bold"
137
+ msgstr "Negrita"
138
+
139
+ #: options-sanitize.php:347
140
+ msgid "Bold Italic"
141
+ msgstr "Negrita Cursiva"
142
+
lang/optionsframework-pt_BR.mo ADDED
Binary file
lang/optionsframework-pt_BR.po ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-22 15:51-0300\n"
6
+ "PO-Revision-Date: 2012-04-22 16:04-0300\n"
7
+ "Last-Translator: Weslly Honorato <weslly.honorato@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n"
13
+ "X-Poedit-Language: Portuguese\n"
14
+ "X-Poedit-Country: BRAZIL\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: options-framework.php:71
18
+ #, php-format
19
+ msgid "Your current theme does not have support for the Options Framework plugin. <a href=\"%1$s\" target=\"_blank\">Learn More</a> | <a href=\"%2$s\">Hide Notice</a>"
20
+ msgstr "Seu tema atual não suporta o plugin Options Framework. <a href=\"%1$s\" target=\"_blank\">Saiba Mais</a> | <a href=\"%2$s\">Esconder Alerta</a>"
21
+
22
+ #: options-framework.php:254
23
+ #: options-framework.php:456
24
+ msgid "Theme Options"
25
+ msgstr "Opções do Tema"
26
+
27
+ #: options-framework.php:323
28
+ msgid "Save Options"
29
+ msgstr "Salvar Opções"
30
+
31
+ #: options-framework.php:324
32
+ msgid "Restore Defaults"
33
+ msgstr "Restaurar Padrões"
34
+
35
+ #: options-framework.php:324
36
+ msgid "Click OK to reset. Any theme settings will be lost!"
37
+ msgstr "Clique em OK para restaurar. As configurações feitas anteriormente serão perdidas!"
38
+
39
+ #: options-framework.php:358
40
+ msgid "Default options restored."
41
+ msgstr "Opções padrão restauradas."
42
+
43
+ #: options-framework.php:400
44
+ msgid "Options saved."
45
+ msgstr "Opções salvas."
46
+
47
+ #: options-medialibrary-uploader.php:26
48
+ msgid "Options Framework Internal Container"
49
+ msgstr "Container Interno do Options Framework"
50
+
51
+ #: options-medialibrary-uploader.php:128
52
+ msgid "Upload"
53
+ msgstr "Upload"
54
+
55
+ #: options-medialibrary-uploader.php:151
56
+ msgid "View File"
57
+ msgstr "Visualizar Arquivo"
58
+
59
+ #: options-medialibrary-uploader.php:288
60
+ msgid "Gallery"
61
+ msgstr "Galeria"
62
+
63
+ #: options-medialibrary-uploader.php:288
64
+ msgid "Previously Uploaded"
65
+ msgstr "Enviado Anteriormente"
66
+
67
+ #: options-sanitize.php:232
68
+ msgid "No Repeat"
69
+ msgstr "Sem Repetição"
70
+
71
+ #: options-sanitize.php:233
72
+ msgid "Repeat Horizontally"
73
+ msgstr "Repetir Horizontalmente"
74
+
75
+ #: options-sanitize.php:234
76
+ msgid "Repeat Vertically"
77
+ msgstr "Repetir Verticalmente"
78
+
79
+ #: options-sanitize.php:235
80
+ msgid "Repeat All"
81
+ msgstr "Repetir"
82
+
83
+ #: options-sanitize.php:248
84
+ msgid "Top Left"
85
+ msgstr "Superior Esquerda"
86
+
87
+ #: options-sanitize.php:249
88
+ msgid "Top Center"
89
+ msgstr "Superior Centro"
90
+
91
+ #: options-sanitize.php:250
92
+ msgid "Top Right"
93
+ msgstr "Superior Direita"
94
+
95
+ #: options-sanitize.php:251
96
+ msgid "Middle Left"
97
+ msgstr "Meio Esquerda"
98
+
99
+ #: options-sanitize.php:252
100
+ msgid "Middle Center"
101
+ msgstr "Meio Centro"
102
+
103
+ #: options-sanitize.php:253
104
+ msgid "Middle Right"
105
+ msgstr "Meio Direita"
106
+
107
+ #: options-sanitize.php:254
108
+ msgid "Bottom Left"
109
+ msgstr "Inferior Esquerda"
110
+
111
+ #: options-sanitize.php:255
112
+ msgid "Bottom Center"
113
+ msgstr "Inferior Centro"
114
+
115
+ #: options-sanitize.php:256
116
+ msgid "Bottom Right"
117
+ msgstr "Inferior Direita"
118
+
119
+ #: options-sanitize.php:269
120
+ msgid "Scroll Normally"
121
+ msgstr "Rolar Normalmente"
122
+
123
+ #: options-sanitize.php:270
124
+ msgid "Fixed in Place"
125
+ msgstr "Fixado no Local"
126
+
127
+ #: options-sanitize.php:344
128
+ msgid "Normal"
129
+ msgstr "Normal"
130
+
131
+ #: options-sanitize.php:345
132
+ msgid "Italic"
133
+ msgstr "Itálico"
134
+
135
+ #: options-sanitize.php:346
136
+ msgid "Bold"
137
+ msgstr "Negrito"
138
+
139
+ #: options-sanitize.php:347
140
+ msgid "Bold Italic"
141
+ msgstr "Negrito e Itálico"
142
+
lang/optionsframework.pot ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-04-22 15:51-0300\n"
6
+ "PO-Revision-Date: 2012-04-22 15:52-0300\n"
7
+ "Last-Translator: Weslly Honorato <weslly.honorato@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n"
13
+ "X-Poedit-Basepath: /Users/weslly/Desktop/options-framework-plugin\n"
14
+ "X-Poedit-SearchPath-0: .\n"
15
+
16
+ #: options-framework.php:71
17
+ #, php-format
18
+ msgid "Your current theme does not have support for the Options Framework plugin. <a href=\"%1$s\" target=\"_blank\">Learn More</a> | <a href=\"%2$s\">Hide Notice</a>"
19
+ msgstr ""
20
+
21
+ #: options-framework.php:254
22
+ #: options-framework.php:456
23
+ msgid "Theme Options"
24
+ msgstr ""
25
+
26
+ #: options-framework.php:323
27
+ msgid "Save Options"
28
+ msgstr ""
29
+
30
+ #: options-framework.php:324
31
+ msgid "Restore Defaults"
32
+ msgstr ""
33
+
34
+ #: options-framework.php:324
35
+ msgid "Click OK to reset. Any theme settings will be lost!"
36
+ msgstr ""
37
+
38
+ #: options-framework.php:358
39
+ msgid "Default options restored."
40
+ msgstr ""
41
+
42
+ #: options-framework.php:400
43
+ msgid "Options saved."
44
+ msgstr ""
45
+
46
+ #: options-medialibrary-uploader.php:26
47
+ msgid "Options Framework Internal Container"
48
+ msgstr ""
49
+
50
+ #: options-medialibrary-uploader.php:128
51
+ msgid "Upload"
52
+ msgstr ""
53
+
54
+ #: options-medialibrary-uploader.php:151
55
+ msgid "View File"
56
+ msgstr ""
57
+
58
+ #: options-medialibrary-uploader.php:288
59
+ msgid "Gallery"
60
+ msgstr ""
61
+
62
+ #: options-medialibrary-uploader.php:288
63
+ msgid "Previously Uploaded"
64
+ msgstr ""
65
+
66
+ #: options-sanitize.php:232
67
+ msgid "No Repeat"
68
+ msgstr ""
69
+
70
+ #: options-sanitize.php:233
71
+ msgid "Repeat Horizontally"
72
+ msgstr ""
73
+
74
+ #: options-sanitize.php:234
75
+ msgid "Repeat Vertically"
76
+ msgstr ""
77
+
78
+ #: options-sanitize.php:235
79
+ msgid "Repeat All"
80
+ msgstr ""
81
+
82
+ #: options-sanitize.php:248
83
+ msgid "Top Left"
84
+ msgstr ""
85
+
86
+ #: options-sanitize.php:249
87
+ msgid "Top Center"
88
+ msgstr ""
89
+
90
+ #: options-sanitize.php:250
91
+ msgid "Top Right"
92
+ msgstr ""
93
+
94
+ #: options-sanitize.php:251
95
+ msgid "Middle Left"
96
+ msgstr ""
97
+
98
+ #: options-sanitize.php:252
99
+ msgid "Middle Center"
100
+ msgstr ""
101
+
102
+ #: options-sanitize.php:253
103
+ msgid "Middle Right"
104
+ msgstr ""
105
+
106
+ #: options-sanitize.php:254
107
+ msgid "Bottom Left"
108
+ msgstr ""
109
+
110
+ #: options-sanitize.php:255
111
+ msgid "Bottom Center"
112
+ msgstr ""
113
+
114
+ #: options-sanitize.php:256
115
+ msgid "Bottom Right"
116
+ msgstr ""
117
+
118
+ #: options-sanitize.php:269
119
+ msgid "Scroll Normally"
120
+ msgstr ""
121
+
122
+ #: options-sanitize.php:270
123
+ msgid "Fixed in Place"
124
+ msgstr ""
125
+
126
+ #: options-sanitize.php:344
127
+ msgid "Normal"
128
+ msgstr ""
129
+
130
+ #: options-sanitize.php:345
131
+ msgid "Italic"
132
+ msgstr ""
133
+
134
+ #: options-sanitize.php:346
135
+ msgid "Bold"
136
+ msgstr ""
137
+
138
+ #: options-sanitize.php:347
139
+ msgid "Bold Italic"
140
+ msgstr ""
141
+
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: 1.1
7
  Author: Devin Price
8
  Author URI: http://www.wptheming.com
9
  License: GPLv2
@@ -27,9 +27,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
 
28
  /* Basic plugin definitions */
29
 
30
- define('OPTIONS_FRAMEWORK_VERSION', '1.1');
31
  define('OPTIONS_FRAMEWORK_URL', plugin_dir_url( __FILE__ ));
32
 
 
 
33
  /* Make sure we don't expose any info if called directly */
34
 
35
  if ( !function_exists( 'add_action' ) ) {
@@ -66,7 +68,7 @@ function optionsframework_admin_notice() {
66
  $user_id = $current_user->ID;
67
  if ( ! get_user_meta($user_id, 'optionsframework_ignore_notice') ) {
68
  echo '<div class="updated optionsframework_setup_nag"><p>';
69
- printf(__('Your current theme does not have support for the Options Framework plugin. <a href="%1$s" target="_blank">Learn More</a> | <a href="%2$s">Hide Notice</a>'), 'http://wptheming.com/options-framework-plugin', '?optionsframework_nag_ignore=0');
70
  echo "</p></div>";
71
  }
72
  }
@@ -178,8 +180,6 @@ function optionsframework_init() {
178
  register_setting( 'optionsframework', $optionsframework_settings['id'], 'optionsframework_validate' );
179
  // Change the capability required to save the 'optionsframework' options group.
180
  add_filter( 'option_page_capability_optionsframework', 'optionsframework_page_capability' );
181
-
182
-
183
  }
184
 
185
  /**
@@ -249,19 +249,19 @@ function optionsframework_setdefaults() {
249
  if ( !function_exists( 'optionsframework_add_page' ) ) {
250
 
251
  function optionsframework_add_page() {
252
- $of_page = add_theme_page('Theme Options', 'Theme Options', 'edit_theme_options', 'options-framework','optionsframework_page');
253
-
254
  // Load the required CSS and javscript
255
  add_action('admin_enqueue_scripts', 'optionsframework_load_scripts');
256
  add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' );
257
  }
258
-
259
  }
260
 
261
  /* Loads the CSS */
262
 
263
  function optionsframework_load_styles() {
264
- wp_enqueue_style('admin-style', OPTIONS_FRAMEWORK_URL.'css/admin-style.css');
265
  wp_enqueue_style('color-picker', OPTIONS_FRAMEWORK_URL.'css/colorpicker.css');
266
  }
267
 
@@ -271,12 +271,12 @@ function optionsframework_load_scripts($hook) {
271
 
272
  if ( 'appearance_page_options-framework' != $hook )
273
  return;
274
-
275
  // Enqueued scripts
276
  wp_enqueue_script('jquery-ui-core');
277
  wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_URL .'js/colorpicker.js', array('jquery'));
278
  wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_URL .'js/options-custom.js', array('jquery'));
279
-
280
  // Inline scripts from options-interface.php
281
  add_action('admin_head', 'of_admin_head');
282
  }
@@ -318,8 +318,8 @@ if ( !function_exists( 'optionsframework_page' ) ) {
318
  <?php optionsframework_fields(); /* Settings */ ?>
319
 
320
  <div id="optionsframework-submit">
321
- <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options' ); ?>" />
322
- <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!' ) ); ?>' );" />
323
  <div class="clear"></div>
324
  </div>
325
  </form>
@@ -342,8 +342,6 @@ if ( !function_exists( 'optionsframework_page' ) ) {
342
  */
343
  function optionsframework_validate( $input ) {
344
 
345
- //var_dump($input);
346
-
347
  /*
348
  * Restore Defaults.
349
  *
@@ -451,7 +449,7 @@ function optionsframework_adminbar() {
451
  $wp_admin_bar->add_menu( array(
452
  'parent' => 'appearance',
453
  'id' => 'of_theme_options',
454
- 'title' => __( 'Theme Options' ),
455
  'href' => admin_url( 'themes.php?page=options-framework' )
456
  ));
457
  }
3
  Plugin Name: Options Framework
4
  Plugin URI: http://www.wptheming.com
5
  Description: A framework for building theme options.
6
+ Version: 1.2
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', '1.2');
31
  define('OPTIONS_FRAMEWORK_URL', plugin_dir_url( __FILE__ ));
32
 
33
+ load_plugin_textdomain( 'optionsframework', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
34
+
35
  /* Make sure we don't expose any info if called directly */
36
 
37
  if ( !function_exists( 'add_action' ) ) {
68
  $user_id = $current_user->ID;
69
  if ( ! get_user_meta($user_id, 'optionsframework_ignore_notice') ) {
70
  echo '<div class="updated optionsframework_setup_nag"><p>';
71
+ printf( __('Your current theme does not have support for the Options Framework plugin. <a href="%1$s" target="_blank">Learn More</a> | <a href="%2$s">Hide Notice</a>', 'optionsframework'), 'http://wptheming.com/options-framework-plugin', '?optionsframework_nag_ignore=0');
72
  echo "</p></div>";
73
  }
74
  }
180
  register_setting( 'optionsframework', $optionsframework_settings['id'], 'optionsframework_validate' );
181
  // Change the capability required to save the 'optionsframework' options group.
182
  add_filter( 'option_page_capability_optionsframework', 'optionsframework_page_capability' );
 
 
183
  }
184
 
185
  /**
249
  if ( !function_exists( 'optionsframework_add_page' ) ) {
250
 
251
  function optionsframework_add_page() {
252
+ $of_page = add_theme_page(__('Theme Options', 'optionsframework'), __('Theme Options', 'optionsframework'), 'edit_theme_options', 'options-framework','optionsframework_page');
253
+
254
  // Load the required CSS and javscript
255
  add_action('admin_enqueue_scripts', 'optionsframework_load_scripts');
256
  add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' );
257
  }
258
+
259
  }
260
 
261
  /* Loads the CSS */
262
 
263
  function optionsframework_load_styles() {
264
+ wp_enqueue_style('optionsframework', OPTIONS_FRAMEWORK_URL.'css/optionsframework.css');
265
  wp_enqueue_style('color-picker', OPTIONS_FRAMEWORK_URL.'css/colorpicker.css');
266
  }
267
 
271
 
272
  if ( 'appearance_page_options-framework' != $hook )
273
  return;
274
+
275
  // Enqueued scripts
276
  wp_enqueue_script('jquery-ui-core');
277
  wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_URL .'js/colorpicker.js', array('jquery'));
278
  wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_URL .'js/options-custom.js', array('jquery'));
279
+
280
  // Inline scripts from options-interface.php
281
  add_action('admin_head', 'of_admin_head');
282
  }
318
  <?php optionsframework_fields(); /* Settings */ ?>
319
 
320
  <div id="optionsframework-submit">
321
+ <input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'optionsframework' ); ?>" />
322
+ <input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults', 'optionsframework' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!', 'optionsframework' ) ); ?>' );" />
323
  <div class="clear"></div>
324
  </div>
325
  </form>
342
  */
343
  function optionsframework_validate( $input ) {
344
 
 
 
345
  /*
346
  * Restore Defaults.
347
  *
449
  $wp_admin_bar->add_menu( array(
450
  'parent' => 'appearance',
451
  'id' => 'of_theme_options',
452
+ 'title' => __( 'Theme Options', 'optionsframework' ),
453
  'href' => admin_url( 'themes.php?page=options-framework' )
454
  ));
455
  }
options-interface.php CHANGED
@@ -343,7 +343,11 @@ function optionsframework_fields() {
343
 
344
  // Info
345
  case "info":
 
346
  $class = 'section';
 
 
 
347
  if ( isset( $value['type'] ) ) {
348
  $class .= ' section-' . $value['type'];
349
  }
@@ -351,7 +355,7 @@ function optionsframework_fields() {
351
  $class .= ' ' . $value['class'];
352
  }
353
 
354
- $output .= '<div class="' . esc_attr( $class ) . '">' . "\n";
355
  if ( isset($value['name']) ) {
356
  $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
357
  }
343
 
344
  // Info
345
  case "info":
346
+ $id = '';
347
  $class = 'section';
348
+ if ( isset( $value['id'] ) ) {
349
+ $id = 'id="' . esc_attr( $value['id'] ) . '" ';
350
+ }
351
  if ( isset( $value['type'] ) ) {
352
  $class .= ' section-' . $value['type'];
353
  }
355
  $class .= ' ' . $value['class'];
356
  }
357
 
358
+ $output .= '<div ' . $id . 'class="' . esc_attr( $class ) . '">' . "\n";
359
  if ( isset($value['name']) ) {
360
  $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
361
  }
options-medialibrary-uploader.php CHANGED
@@ -23,7 +23,7 @@ if ( ! function_exists( 'optionsframework_mlu_init' ) ) {
23
  function optionsframework_mlu_init () {
24
  register_post_type( 'optionsframework', array(
25
  'labels' => array(
26
- 'name' => __( 'Options Framework Internal Container' ),
27
  ),
28
  'public' => true,
29
  'show_ui' => false,
@@ -33,7 +33,8 @@ if ( ! function_exists( 'optionsframework_mlu_init' ) ) {
33
  'supports' => array( 'title', 'editor' ),
34
  'query_var' => false,
35
  'can_export' => true,
36
- 'show_in_nav_menus' => false
 
37
  ) );
38
  }
39
  }
23
  function optionsframework_mlu_init () {
24
  register_post_type( 'optionsframework', array(
25
  'labels' => array(
26
+ 'name' => __( 'Theme Options Media' ),
27
  ),
28
  'public' => true,
29
  'show_ui' => false,
33
  'supports' => array( 'title', 'editor' ),
34
  'query_var' => false,
35
  'can_export' => true,
36
+ 'show_in_nav_menus' => false,
37
+ 'public' => false
38
  ) );
39
  }
40
  }
options-sanitize.php CHANGED
@@ -48,7 +48,7 @@ function of_sanitize_multicheck( $input, $option ) {
48
  }
49
  foreach( $input as $key => $value ) {
50
  if ( array_key_exists( $key, $option['options'] ) && $value ) {
51
- $output[$key] = "1";
52
  }
53
  }
54
  }
@@ -167,14 +167,14 @@ add_filter( 'of_background_attachment', 'of_sanitize_background_attachment' );
167
  /* Typography */
168
 
169
  function of_sanitize_typography( $input, $option ) {
170
-
171
  $output = wp_parse_args( $input, array(
172
  'size' => '',
173
  'face' => '',
174
  'style' => '',
175
  'color' => ''
176
  ) );
177
-
178
  if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) {
179
  if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) {
180
  $output['face'] = '';
@@ -193,13 +193,13 @@ add_filter( 'of_sanitize_typography', 'of_sanitize_typography', 10, 2 );
193
 
194
  function of_sanitize_font_size( $value ) {
195
  $recognized = of_recognized_font_sizes();
196
- $value = preg_replace('/px/','', $value);
197
- if ( in_array( (int) $value, $recognized ) ) {
198
- return (int) $value;
199
  }
200
- return (int) apply_filters( 'of_default_font_size', $recognized );
201
  }
202
- add_filter( 'of_font_face', 'of_sanitize_font_size' );
203
 
204
 
205
  function of_sanitize_font_style( $value ) {
@@ -229,10 +229,10 @@ add_filter( 'of_font_face', 'of_sanitize_font_face' );
229
  */
230
  function of_recognized_background_repeat() {
231
  $default = array(
232
- 'no-repeat' => 'No Repeat',
233
- 'repeat-x' => 'Repeat Horizontally',
234
- 'repeat-y' => 'Repeat Vertically',
235
- 'repeat' => 'Repeat All',
236
  );
237
  return apply_filters( 'of_recognized_background_repeat', $default );
238
  }
@@ -245,15 +245,15 @@ function of_recognized_background_repeat() {
245
  */
246
  function of_recognized_background_position() {
247
  $default = array(
248
- 'top left' => 'Top Left',
249
- 'top center' => 'Top Center',
250
- 'top right' => 'Top Right',
251
- 'center left' => 'Middle Left',
252
- 'center center' => 'Middle Center',
253
- 'center right' => 'Middle Right',
254
- 'bottom left' => 'Bottom Left',
255
- 'bottom center' => 'Bottom Center',
256
- 'bottom right' => 'Bottom Right'
257
  );
258
  return apply_filters( 'of_recognized_background_position', $default );
259
  }
@@ -266,8 +266,8 @@ function of_recognized_background_position() {
266
  */
267
  function of_recognized_background_attachment() {
268
  $default = array(
269
- 'scroll' => 'Scroll Normally',
270
- 'fixed' => 'Fixed in Place'
271
  );
272
  return apply_filters( 'of_recognized_background_attachment', $default );
273
  }
@@ -280,7 +280,7 @@ function of_recognized_background_attachment() {
280
  * @return string
281
  *
282
  */
283
-
284
  function of_sanitize_hex( $hex, $default = '' ) {
285
  if ( of_validate_hex( $hex ) ) {
286
  return $hex;
@@ -297,7 +297,7 @@ function of_sanitize_hex( $hex, $default = '' ) {
297
  *
298
  * @return array
299
  */
300
-
301
  function of_recognized_font_sizes() {
302
  $sizes = range( 9, 71 );
303
  $sizes = apply_filters( 'of_recognized_font_sizes', $sizes );
@@ -341,10 +341,10 @@ function of_recognized_font_faces() {
341
  */
342
  function of_recognized_font_styles() {
343
  $default = array(
344
- 'normal' => 'Normal',
345
- 'italic' => 'Italic',
346
- 'bold' => 'Bold',
347
- 'bold italic' => 'Bold Italic'
348
  );
349
  return apply_filters( 'of_recognized_font_styles', $default );
350
  }
@@ -356,7 +356,7 @@ function of_recognized_font_styles() {
356
  * @return bool
357
  *
358
  */
359
-
360
  function of_validate_hex( $hex ) {
361
  $hex = trim( $hex );
362
  /* Strip recognized prefixes. */
48
  }
49
  foreach( $input as $key => $value ) {
50
  if ( array_key_exists( $key, $option['options'] ) && $value ) {
51
+ $output[$key] = "1";
52
  }
53
  }
54
  }
167
  /* Typography */
168
 
169
  function of_sanitize_typography( $input, $option ) {
170
+
171
  $output = wp_parse_args( $input, array(
172
  'size' => '',
173
  'face' => '',
174
  'style' => '',
175
  'color' => ''
176
  ) );
177
+
178
  if ( isset( $option['options']['faces'] ) && isset( $input['face'] ) ) {
179
  if ( !( array_key_exists( $input['face'], $option['options']['faces'] ) ) ) {
180
  $output['face'] = '';
193
 
194
  function of_sanitize_font_size( $value ) {
195
  $recognized = of_recognized_font_sizes();
196
+ $value_check = preg_replace('/px/','', $value);
197
+ if ( in_array( (int) $value_check, $recognized ) ) {
198
+ return $value;
199
  }
200
+ return apply_filters( 'of_default_font_size', $recognized );
201
  }
202
+ add_filter( 'of_font_size', 'of_sanitize_font_size' );
203
 
204
 
205
  function of_sanitize_font_style( $value ) {
229
  */
230
  function of_recognized_background_repeat() {
231
  $default = array(
232
+ 'no-repeat' => __('No Repeat', 'optionsframework'),
233
+ 'repeat-x' => __('Repeat Horizontally', 'optionsframework'),
234
+ 'repeat-y' => __('Repeat Vertically', 'optionsframework'),
235
+ 'repeat' => __('Repeat All', 'optionsframework'),
236
  );
237
  return apply_filters( 'of_recognized_background_repeat', $default );
238
  }
245
  */
246
  function of_recognized_background_position() {
247
  $default = array(
248
+ 'top left' => __('Top Left', 'optionsframework'),
249
+ 'top center' => __('Top Center', 'optionsframework'),
250
+ 'top right' => __('Top Right', 'optionsframework'),
251
+ 'center left' => __('Middle Left', 'optionsframework'),
252
+ 'center center' => __('Middle Center', 'optionsframework'),
253
+ 'center right' => __('Middle Right', 'optionsframework'),
254
+ 'bottom left' => __('Bottom Left', 'optionsframework'),
255
+ 'bottom center' => __('Bottom Center', 'optionsframework'),
256
+ 'bottom right' => __('Bottom Right', 'optionsframework')
257
  );
258
  return apply_filters( 'of_recognized_background_position', $default );
259
  }
266
  */
267
  function of_recognized_background_attachment() {
268
  $default = array(
269
+ 'scroll' => __('Scroll Normally', 'optionsframework'),
270
+ 'fixed' => __('Fixed in Place', 'optionsframework')
271
  );
272
  return apply_filters( 'of_recognized_background_attachment', $default );
273
  }
280
  * @return string
281
  *
282
  */
283
+
284
  function of_sanitize_hex( $hex, $default = '' ) {
285
  if ( of_validate_hex( $hex ) ) {
286
  return $hex;
297
  *
298
  * @return array
299
  */
300
+
301
  function of_recognized_font_sizes() {
302
  $sizes = range( 9, 71 );
303
  $sizes = apply_filters( 'of_recognized_font_sizes', $sizes );
341
  */
342
  function of_recognized_font_styles() {
343
  $default = array(
344
+ 'normal' => __('Normal', 'optionsframework'),
345
+ 'italic' => __('Italic', 'optionsframework'),
346
+ 'bold' => __('Bold', 'optionsframework'),
347
+ 'bold italic' => __('Bold Italic', 'optionsframework')
348
  );
349
  return apply_filters( 'of_recognized_font_styles', $default );
350
  }
356
  * @return bool
357
  *
358
  */
359
+
360
  function of_validate_hex( $hex ) {
361
  $hex = trim( $hex );
362
  /* Strip recognized prefixes. */
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  === Options Framework ===
 
2
  Contributors: Devin Price
3
  Tags: options, theme options
4
  Donate link: http://bit.ly/options-donate
5
  Requires at least: 3.3
6
- Tested up to: 3.3
7
- Stable tag: 1.1
8
  License: GPLv2
9
 
10
  == Description ==
@@ -24,6 +25,7 @@ The Options Framework Plugin makes it easy to include an options panel in any Wo
24
  * multicheck
25
  * color (a jquery color picker)
26
  * typography (a set of options to define typography)
 
27
 
28
  = Learn More =
29
 
@@ -65,6 +67,15 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
 
 
 
 
68
  = 1.1 =
69
 
70
  * Added support for wp_editor
1
  === Options Framework ===
2
+
3
  Contributors: Devin Price
4
  Tags: options, theme options
5
  Donate link: http://bit.ly/options-donate
6
  Requires at least: 3.3
7
+ Tested up to: 3.4
8
+ Stable tag: 1.2
9
  License: GPLv2
10
 
11
  == Description ==
25
  * multicheck
26
  * color (a jquery color picker)
27
  * typography (a set of options to define typography)
28
+ * editor
29
 
30
  = Learn More =
31
 
67
 
68
  == Changelog ==
69
 
70
+ = 1.2 =
71
+
72
+ * Fix for font_size santization
73
+ * Added internationalization support (@weslly)
74
+ * Portuguese translations (@weslly)
75
+ * Spanish translations (@sksmatt)
76
+ * Make uploader post type non-public (@samargulies)
77
+ * ID can now be passed on info option for styling purposes
78
+
79
  = 1.1 =
80
 
81
  * Added support for wp_editor