wc_bool_to_string()
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 bool to string WC 10.3.6
function wc_bool_to_string( $bool ) {
if ( ! is_bool( $bool ) ) {
$bool = wc_string_to_bool( $bool );
}
return true === $bool ? 'yes' : 'no';
}