Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 379 lines (363 sloc) 13.221 kb
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
1 <?php
2 /**
3 * Oenology Theme Options Settings API
4 *
5 * This file implements the WordPress Settings API for the
6 * Options for the Oenology Theme.
7 *
8 * @package Oenology
9 * @copyright Copyright (c) 2011, Chip Bennett
10 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
11 *
12 * @since Oenology 1.0
13 */
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
14
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
15 /**
16 * Register Theme Settings
17 *
18 * Register theme_oenology_options array to hold
19 * all Theme options.
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
20 *
21 * @link http://codex.wordpress.org/Function_Reference/register_setting Codex Reference: register_setting()
22 *
23 * @param string $option_group Unique Settings API identifier; passed to settings_fields() call
24 * @param string $option_name Name of the wp_options database table entry
25 * @param callback $sanitize_callback Name of the callback function in which user input data are sanitized
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
26 */
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
27 register_setting(
28 // $option_group
29 'theme_oenology_options',
30 // $option_name
31 'theme_oenology_options',
32 // $sanitize_callback
33 'oenology_options_validate'
34 );
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
35
afd0c1d @chipbennett Re: Issue #72: fixes settings not saving due to settingsbytab in registe...
authored
36
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
37 /**
afd0c1d @chipbennett Re: Issue #72: fixes settings not saving due to settingsbytab in registe...
authored
38 * Theme register_setting() sanitize callback
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
39 *
40 * Validate and whitelist user-input data before updating Theme
41 * Options in the database. Only whitelisted options are passed
42 * back to the database, and user-input data for all whitelisted
43 * options are sanitized.
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
44 *
45 * @link http://codex.wordpress.org/Data_Validation Codex Reference: Data Validation
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
46 *
47 * @param array $input Raw user-input data submitted via the Theme Settings page
48 * @return array $input Sanitized user-input data passed to the database
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
49 */
50 function oenology_options_validate( $input ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
51 // This is the "whitelist": current settings
9c29147 @chipbennett Fixes Issue #41 use oenology_get_options() globally
authored
52 $valid_input = oenology_get_options();
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
53 // Get the array of Theme settings, by Settings Page tab
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
54 $settingsbytab = oenology_get_settings_by_tab();
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
55 // Get the array of option parameters
56 $option_parameters = oenology_get_option_parameters();
57 // Get the array of option defaults
58 $option_defaults = oenology_get_option_defaults();
1cffa88 @chipbennett Per Issue #22 adds layout option handling to Theme Admin
authored
59 // Get list of tabs
60 $tabs = oenology_get_settings_page_tabs();
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
61
62 // Determine what type of submit was input
1cffa88 @chipbennett Per Issue #22 adds layout option handling to Theme Admin
authored
63 $submittype = 'submit';
64 foreach ( $tabs as $tab ) {
65 $resetname = 'reset-' . $tab['name'];
66 if ( ! empty( $input[$resetname] ) ) {
67 $submittype = 'reset';
68 }
69 }
70
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
71 // Determine what tab was input
b7bb04a @chipbennett For Issue #22 cleanup tab handling
authored
72 $submittab = 'varietals';
1cffa88 @chipbennett Per Issue #22 adds layout option handling to Theme Admin
authored
73 foreach ( $tabs as $tab ) {
74 $submitname = 'submit-' . $tab['name'];
75 $resetname = 'reset-' . $tab['name'];
76 if ( ! empty( $input[$submitname] ) || ! empty($input[$resetname] ) ) {
77 $submittab = $tab['name'];
78 }
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
79 }
afd0c1d @chipbennett Re: Issue #72: fixes settings not saving due to settingsbytab in registe...
authored
80 global $wp_customize;
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
81 // Get settings by tab
afd0c1d @chipbennett Re: Issue #72: fixes settings not saving due to settingsbytab in registe...
authored
82 $tabsettings = ( isset ( $wp_customize ) ? $settingsbytab['all'] : $settingsbytab[$submittab] );
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
83 // Loop through each tab setting
84 foreach ( $tabsettings as $setting ) {
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
85 // If no option is selected, set the default
86 $valid_input[$setting] = ( ! isset( $input[$setting] ) ? $option_defaults[$setting] : $input[$setting] );
87
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
88 // If submit, validate/sanitize $input
89 if ( 'submit' == $submittype ) {
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
90
c1942cf @chipbennett Fixes Issue #10: some code improvements. Props cyonite @andreasnrb.
authored
91 // Get the setting details from the defaults array
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
92 $optiondetails = $option_parameters[$setting];
93 // Get the array of valid options, if applicable
94 $valid_options = ( isset( $optiondetails['valid_options'] ) ? $optiondetails['valid_options'] : false );
95
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
96 // Validate checkbox fields
97 if ( 'checkbox' == $optiondetails['type'] ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
98 // If input value is set and is true, return true; otherwise return false
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
99 $valid_input[$setting] = ( ( isset( $input[$setting] ) && true == $input[$setting] ) ? true : false );
100 }
101 // Validate radio button fields
102 else if ( 'radio' == $optiondetails['type'] ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
103 // Only update setting if input value is in the list of valid options
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
104 $valid_input[$setting] = ( array_key_exists( $input[$setting], $valid_options ) ? $input[$setting] : $valid_input[$setting] );
105 }
106 // Validate select fields
107 else if ( 'select' == $optiondetails['type'] ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
108 // Only update setting if input value is in the list of valid options
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
109 $valid_input[$setting] = ( array_key_exists( $input[$setting], $valid_options ) ? $input[$setting] : $valid_input[$setting] );
110 }
111 // Validate text input and textarea fields
112 else if ( ( 'text' == $optiondetails['type'] || 'textarea' == $optiondetails['type'] ) ) {
113 // Validate no-HTML content
114 if ( 'nohtml' == $optiondetails['sanitize'] ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
115 // Pass input data through the wp_filter_nohtml_kses filter
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
116 $valid_input[$setting] = wp_filter_nohtml_kses( $input[$setting] );
117 }
118 // Validate HTML content
119 if ( 'html' == $optiondetails['sanitize'] ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
120 // Pass input data through the wp_filter_kses filter
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
121 $valid_input[$setting] = wp_filter_kses( $input[$setting] );
122 }
123 }
124 // Validate custom fields
125 else if ( 'custom' == $optiondetails['type'] ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
126 // Validate the Varietal setting
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
127 if ( 'varietal' == $setting ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
128 // Only update setting if input value is in the list of valid options
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
129 $valid_input[$setting] = ( array_key_exists( $input[$setting], $valid_options ) ? $input[$setting] : $valid_input[$setting] );
130 }
131 }
132 }
133 // If reset, reset defaults
134 elseif ( 'reset' == $submittype ) {
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
135 // Set $setting to the default value
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
136 $valid_input[$setting] = $option_defaults[$setting];
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
137 }
138 }
139 return $valid_input;
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
140
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
141 }
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
142
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
143 /**
144 * Globalize the variable that holds
145 * the Settings Page tab definitions
146 *
147 * @global array Settings Page Tab definitions
148 */
149 global $oenology_tabs;
150 $oenology_tabs = oenology_get_settings_page_tabs();
151 /**
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
152 * Call add_settings_section() for each Settings
153 *
154 * Loop through each Theme Settings page tab, and add
155 * a new section to the Theme Settings page for each
156 * section specified for each tab.
157 *
158 * @link http://codex.wordpress.org/Function_Reference/add_settings_section Codex Reference: add_settings_section()
159 *
160 * @param string $sectionid Unique Settings API identifier; passed to add_settings_field() call
161 * @param string $title Title of the Settings page section
162 * @param callback $callback Name of the callback function in which section text is output
163 * @param string $pageid Name of the Settings page to which to add the section; passed to do_settings_sections()
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
164 */
165 foreach ( $oenology_tabs as $tab ) {
166 $tabname = $tab['name'];
167 $tabsections = $tab['sections'];
168 foreach ( $tabsections as $section ) {
169 $sectionname = $section['name'];
170 $sectiontitle = $section['title'];
171 // Add settings section
172 add_settings_section(
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
173 // $sectionid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
174 'oenology_' . $sectionname . '_section',
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
175 // $title
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
176 $sectiontitle,
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
177 // $callback
178 'oenology_sections_callback',
179 // $pageid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
180 'oenology_' . $tabname . '_tab'
181 );
182 }
183 }
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
184
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
185 /**
186 * Callback for add_settings_section()
187 *
188 * Generic callback to output the section text
189 * for each Plugin settings section.
190 *
920db99 @chipbennett Pre-release cleanup
authored
191 * @uses oenology_get_settings_page_tabs() Defined in /functions/options.php
192 *
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
193 * @param array $section_passed Array passed from add_settings_section()
194 */
195 function oenology_sections_callback( $section_passed ) {
196 global $oenology_tabs;
c1942cf @chipbennett Fixes Issue #10: some code improvements. Props cyonite @andreasnrb.
authored
197 $oenology_tabs = oenology_get_settings_page_tabs();
198 foreach ( $oenology_tabs as $tabname => $tab ) {
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
199 $tabsections = $tab['sections'];
c1942cf @chipbennett Fixes Issue #10: some code improvements. Props cyonite @andreasnrb.
authored
200 foreach ( $tabsections as $sectionname => $section ) {
201 if ( 'oenology_' . $sectionname . '_section' == $section_passed['id'] ) {
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
202 ?>
c1942cf @chipbennett Fixes Issue #10: some code improvements. Props cyonite @andreasnrb.
authored
203 <p><?php echo $section['description']; ?></p>
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
204 <?php
205 }
206 }
207 }
208 }
2e646d1 @chipbennett Changed function file names
authored
209
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
210 /**
211 * Globalize the variable that holds
1bf26ff @chipbennett Re: Issue #25 and Issue #34 adds GitHub milestones and documentation cle...
authored
212 * all the Theme option parameters
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
213 *
1bf26ff @chipbennett Re: Issue #25 and Issue #34 adds GitHub milestones and documentation cle...
authored
214 * @global array Theme options parameters
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
215 */
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
216 global $option_parameters;
217 $option_parameters = oenology_get_option_parameters();
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
218 /**
219 * Call add_settings_field() for each Setting Field
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
220 *
221 * Loop through each Theme option, and add a new
222 * setting field to the Theme Settings page for each
223 * setting.
224 *
225 * @link http://codex.wordpress.org/Function_Reference/add_settings_field Codex Reference: add_settings_field()
226 *
227 * @param string $settingid Unique Settings API identifier; passed to the callback function
228 * @param string $title Title of the setting field
229 * @param callback $callback Name of the callback function in which setting field markup is output
230 * @param string $pageid Name of the Settings page to which to add the setting field; passed from add_settings_section()
231 * @param string $sectionid ID of the Settings page section to which to add the setting field; passed from add_settings_section()
232 * @param array $args Array of arguments to pass to the callback function
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
233 */
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
234 foreach ( $option_parameters as $option ) {
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
235 $optionname = $option['name'];
236 $optiontitle = $option['title'];
237 $optiontab = $option['tab'];
238 $optionsection = $option['section'];
239 $optiontype = $option['type'];
b7e8e47 @chipbennett Re Issue #83 removes obsolete 'internal' option type. Props @slobodan
authored
240 if ( 'custom' != $optiontype ) {
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
241 add_settings_field(
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
242 // $settingid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
243 'oenology_setting_' . $optionname,
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
244 // $title
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
245 $optiontitle,
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
246 // $callback
247 'oenology_setting_callback',
248 // $pageid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
249 'oenology_' . $optiontab . '_tab',
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
250 // $sectionid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
251 'oenology_' . $optionsection . '_section',
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
252 // $args
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
253 $option
254 );
255 } if ( 'custom' == $optiontype ) {
256 add_settings_field(
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
257 // $settingid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
258 'oenology_setting_' . $optionname,
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
259 // $title
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
260 $optiontitle,
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
261 //$callback
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
262 'oenology_setting_' . $optionname,
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
263 // $pageid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
264 'oenology_' . $optiontab . '_tab',
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
265 // $sectionid
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
266 'oenology_' . $optionsection . '_section'
267 );
268 }
269 }
270
271 /**
272 * Callback for get_settings_field()
273 */
274 function oenology_setting_callback( $option ) {
9c29147 @chipbennett Fixes Issue #41 use oenology_get_options() globally
authored
275 $oenology_options = oenology_get_options();
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
276 $option_parameters = oenology_get_option_parameters();
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
277 $optionname = $option['name'];
278 $optiontitle = $option['title'];
279 $optiondescription = $option['description'];
280 $fieldtype = $option['type'];
281 $fieldname = 'theme_oenology_options[' . $optionname . ']';
1bf26ff @chipbennett Re: Issue #25 and Issue #34 adds GitHub milestones and documentation cle...
authored
282
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
283 // Output checkbox form field markup
284 if ( 'checkbox' == $fieldtype ) {
285 ?>
286 <input type="checkbox" name="<?php echo $fieldname; ?>" <?php checked( $oenology_options[$optionname] ); ?> />
287 <?php
288 }
289 // Output radio button form field markup
290 else if ( 'radio' == $fieldtype ) {
291 $valid_options = array();
292 $valid_options = $option['valid_options'];
293 foreach ( $valid_options as $valid_option ) {
294 ?>
295 <input type="radio" name="<?php echo $fieldname; ?>" <?php checked( $valid_option['name'] == $oenology_options[$optionname] ); ?> value="<?php echo $valid_option['name']; ?>" />
1cffa88 @chipbennett Per Issue #22 adds layout option handling to Theme Admin
authored
296 <span>
297 <?php echo $valid_option['title']; ?>
298 <?php if ( $valid_option['description'] ) { ?>
299 <span style="padding-left:5px;"><em><?php echo $valid_option['description']; ?></em></span>
300 <?php } ?>
301 </span>
302 <br />
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
303 <?php
997b47f @chipbennett Version 1.2
authored
304 }
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
305 }
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
306 // Output select form field markup
307 else if ( 'select' == $fieldtype ) {
308 $valid_options = array();
309 $valid_options = $option['valid_options'];
310 ?>
311 <select name="<?php echo $fieldname; ?>">
312 <?php
313 foreach ( $valid_options as $valid_option ) {
314 ?>
315 <option <?php selected( $valid_option['name'] == $oenology_options[$optionname] ); ?> value="<?php echo $valid_option['name']; ?>"><?php echo $valid_option['title']; ?></option>
316 <?php
317 }
318 ?>
319 </select>
320 <?php
321 }
322 // Output text input form field markup
323 else if ( 'text' == $fieldtype ) {
324 ?>
325 <input type="text" name="<?php echo $fieldname; ?>" value="<?php echo wp_filter_nohtml_kses( $oenology_options[$optionname] ); ?>" />
326 <?php
327 }
328 // Output the setting description
329 ?>
330 <span class="description"><?php echo $optiondescription; ?></span>
331 <?php
332 }
333
334 /**
335 * Callback for Varietal Setting Custom Form Field Markup
336 */
337 function oenology_setting_varietal() {
16b7d2d @chipbennett Fixes Issue #26 and Issue #27 replace options init and rearrange context...
authored
338 $option_parameters = oenology_get_option_parameters();
339 $oenology_varietals = $option_parameters['varietal']['valid_options'];
56ceea0 @chipbennett Tabbed Settings Submit Buttons now work properly
authored
340
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
341 function oenology_output_varietal( $varietal ) {
9c29147 @chipbennett Fixes Issue #41 use oenology_get_options() globally
authored
342 $oenology_options = oenology_get_options();
da06dd1 @chipbennett Re: Issue #109 makes varietals override-able by Child Themes
authored
343 $varietal_thumbnail = oenology_locate_template_uri( array( '/varietals/' . $varietal['name'] . '.png' ), false, false );
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
344 $currentvarietal = ( $varietal['name'] == $oenology_options['varietal'] ? true : false );
7544f98 @chipbennett Oenology Support admin page has been rolled into contextual help
authored
345 $dlclass = ( $currentvarietal ? 'oenology-varietal oenology-varietal-current' : 'oenology-varietal' );
346 ?>
347 <dl class="<?php echo $dlclass; ?>">
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
348 <dt><strong><?php echo $varietal['title']; ?></strong></dt>
da06dd1 @chipbennett Re: Issue #109 makes varietals override-able by Child Themes
authored
349 <dd><img src="<?php echo $varietal_thumbnail; ?>" width="150px" height="110px" alt="<?php echo $varietal['title']; ?>" title="<?php echo $varietal['description']; ?>" /></dd>
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
350 <dd><input type="radio" name="theme_oenology_options[varietal]" <?php checked( $currentvarietal ); ?> value="<?php echo $varietal['name']; ?>" /></dd>
351 </dl>
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
352 <?php
353 }
354 ?>
ea81079 @chipbennett Re: Issue #94 make strings translatable in functions\options-register.ph...
authored
355 <h4 style="display:block;clear:both;"><?php _e( 'White (Light)', 'oenology' ); ?></h4>
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
356 <?php
357 foreach ( $oenology_varietals as $varietal ) {
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
358 if ( 'light' == $varietal['scheme'] ) {
359 oenology_output_varietal( $varietal );
360 }
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
361 }
362 ?>
ea81079 @chipbennett Re: Issue #94 make strings translatable in functions\options-register.ph...
authored
363 <h4 style="display:block;clear:both;"><?php _e( 'Red (Dark)', 'oenology' ); ?></h4>
a1b5607 @chipbennett A few more settings code improvements and more docs
authored
364 <?php
365 foreach ( $oenology_varietals as $varietal ) {
c21c324 @chipbennett Settings API rewritten and major documentation overhaul
authored
366 if ( 'dark' == $varietal['scheme'] ) {
367 oenology_output_varietal( $varietal );
368 }
369 }
bdecddd @chipbennett Re: Issue #105 and Issue #106 refactor light varietals and fix input sty...
authored
370 ?>
371 <h4 style="display:block;clear:both;"><?php _e( 'Cuvee (unstyled)', 'oenology' ); ?></h4>
372 <?php
373 foreach ( $oenology_varietals as $varietal ) {
374 if ( 'cuvee' == $varietal['scheme'] ) {
375 oenology_output_varietal( $varietal );
376 }
377 }
2fd3049 @chipbennett Theme settings: fixed PHP warning, added Reset Defaults button
authored
378 }
e0d794c @chipbennett Working copy 20110122
authored
379 ?>
Something went wrong with that request. Please try again.