WordPress at Your Fingertips
function is not described

WC_Product_CSV_Importer::parse_bool_field() public WC 1.0

Parse a field that is generally '1' or '0' but can be something else.

{} It's a method of the class: WC_Product_CSV_Importer{}

No Hooks.

Return

true|false|String.

Usage

$WC_Product_CSV_Importer = new WC_Product_CSV_Importer();
$WC_Product_CSV_Importer->parse_bool_field( $value );
$value(string) (required)
Field value.

Code of WC_Product_CSV_Importer::parse_bool_field() WC 5.8.0

public function parse_bool_field( $value ) {
	if ( '0' === $value ) {
		return false;
	}

	if ( '1' === $value ) {
		return true;
	}

	// Don't return explicit true or false for empty fields or values like 'notify'.
	return wc_clean( $value );
}