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
3364eba1f0
commit
14f0bb5154
|
@ -186,10 +186,8 @@ class Twenty_Twelve_Options {
|
||||||
public function validate( $input ) {
|
public function validate( $input ) {
|
||||||
$output = $defaults = $this->get_default_theme_options();
|
$output = $defaults = $this->get_default_theme_options();
|
||||||
|
|
||||||
// The enable fonts checkbox should boolean true or false
|
// The enable fonts checkbox should a boolean value, true or false.
|
||||||
if ( ! isset( $input['enable_fonts'] ) )
|
$output['enable_fonts'] = ( isset( $input['enable_fonts'] ) && $input['enable_fonts'] );
|
||||||
$input['enable_fonts'] = false;
|
|
||||||
$output['enable_fonts'] = ( false != $input['enable_fonts'] ? true : false );
|
|
||||||
|
|
||||||
return apply_filters( 'twentytwelve_options_validate', $output, $input, $defaults );
|
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(
|
$wp_customize->add_setting( $this->option_key . '[enable_fonts]', array(
|
||||||
'default' => $defaults['enable_fonts'],
|
'default' => $defaults['enable_fonts'],
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'capability' => 'edit_theme_options',
|
|
||||||
'transport' => 'postMessage',
|
'transport' => 'postMessage',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue