wc_bool_to_string( bool|string $bool )

Converts a bool to a ‘yes’ or ‘no’.


Description Description


Parameters Parameters

$bool

(Required) Bool to convert. If a string is passed it will first be converted to a bool.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/wc-formatting-functions.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.