wc_format_weight() WC 3.0.0
Format a weight for display.
Хуки из функции
Возвращает
Строку.
Использование
wc_format_weight( $weight );
- $weight(float) (обязательный)
- Weight.
Список изменений
С версии 3.0.0 | Введена. |
Код wc_format_weight() wc format weight WC 5.0.0
function wc_format_weight( $weight ) {
$weight_string = wc_format_localized_decimal( $weight );
if ( ! empty( $weight_string ) ) {
$weight_string .= ' ' . get_option( 'woocommerce_weight_unit' );
} else {
$weight_string = __( 'N/A', 'woocommerce' );
}
return apply_filters( 'woocommerce_format_weight', $weight_string, $weight );
}