Twenty Twelve: theme-options.php fixes from obenland, see #21685.
* Capability is already set to 'edit_theme_options' by default * Simplify logic for form input validation git-svn-id: http://core.svn.wordpress.org/trunk@21623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fe87773446
commit
719e80e8cd
|
@ -186,10 +186,8 @@ class Twenty_Twelve_Options {
|
|||
public function validate( $input ) {
|
||||
$output = $defaults = $this->get_default_theme_options();
|
||||
|
||||
// The enable fonts checkbox should boolean true or false
|
||||
if ( ! isset( $input['enable_fonts'] ) )
|
||||
$input['enable_fonts'] = false;
|
||||
$output['enable_fonts'] = ( false != $input['enable_fonts'] ? true : false );
|
||||
// The enable fonts checkbox should a boolean value, true or false.
|
||||
$output['enable_fonts'] = ( isset( $input['enable_fonts'] ) && $input['enable_fonts'] );
|
||||
|
||||
return apply_filters( 'twentytwelve_options_validate', $output, $input, $defaults );
|
||||
}
|
||||
|
@ -220,7 +218,6 @@ class Twenty_Twelve_Options {
|
|||
$wp_customize->add_setting( $this->option_key . '[enable_fonts]', array(
|
||||
'default' => $defaults['enable_fonts'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue