WordPress at a glance
function is not described

wc_string_to_bool() WC 3.0.0

Converts a string (e.g. 'yes' or 'no') to a bool.

No Hooks.

Return

true|false. Nothing.

Usage

wc_string_to_bool( $string );
$string(string|true|false) (required)
String to convert. If a bool is passed it will be returned as-is.

Changelog

Since 3.0.0 Introduced.

Code of wc_string_to_bool() WC 5.3.0

<?php
function wc_string_to_bool( $string ) {
	return is_bool( $string ) ? $string : ( 'yes' === strtolower( $string ) || 1 === $string || 'true' === strtolower( $string ) || '1' === $string );
}