Fixed checkboxes in the admin settings
This allow set yes/no or null/1 for checkboxes cc @mikejolley @jeffstieler
This commit is contained in:
parent
83d25ed035
commit
a5ba8a05ed
|
@ -697,7 +697,7 @@ class WC_Admin_Settings {
|
|||
// Format the value based on option type.
|
||||
switch ( $option['type'] ) {
|
||||
case 'checkbox' :
|
||||
$value = in_array( $raw_value, array( 'yes', 'no' ) ) ? $raw_value : 'no';
|
||||
$value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no';
|
||||
break;
|
||||
case 'textarea' :
|
||||
$value = wp_kses_post( trim( $raw_value ) );
|
||||
|
|
Loading…
Reference in New Issue