WC_Settings_API::validate_checkbox_field
Validate Checkbox Field.
If not set, return "no", otherwise return "yes".
Method of the class: WC_Settings_API{}
No Hooks.
Returns
String.
Usage
$WC_Settings_API = new WC_Settings_API(); $WC_Settings_API->validate_checkbox_field( $key, $value );
- $key(string) (required)
- Field key.
- $value(string) (required)
- Posted Value.
WC_Settings_API::validate_checkbox_field() WC Settings API::validate checkbox field code WC 10.4.3
public function validate_checkbox_field( $key, $value ) {
return ! is_null( $value ) ? 'yes' : 'no';
}