wc_bool_to_string()
Converts a bool to a 'yes' or 'no'.
No Hooks.
Returns
String.
Usage
wc_bool_to_string( $bool );
- $bool(true|false|string) (required)
- Bool to convert. If a string is passed it will first be converted to a bool.
Changelog
| Since 3.0.0 | Introduced. |
wc_bool_to_string() wc bool to string code WC 10.4.3
function wc_bool_to_string( $bool ) {
if ( ! is_bool( $bool ) ) {
$bool = wc_string_to_bool( $bool );
}
return true === $bool ? 'yes' : 'no';
}