wc_bool_to_string()WC 3.0.0

Converts a bool to a 'yes' or 'no'.

Хуков нет.

Возвращает

Строку.

Использование

wc_bool_to_string( $bool );
$bool(true|false|строка) (обязательный)
Bool to convert. If a string is passed it will first be converted to a bool.

Список изменений

С версии 3.0.0 Введена.

Код wc_bool_to_string() WC 8.7.0

function wc_bool_to_string( $bool ) {
	if ( ! is_bool( $bool ) ) {
		$bool = wc_string_to_bool( $bool );
	}
	return true === $bool ? 'yes' : 'no';
}