wc_format_dimensions( array $dimensions )
Format dimensions for display.
Description Description
Parameters Parameters
- $dimensions
-
(Required) Array of dimensions.
Return Return
(string)
Source Source
File: includes/wc-formatting-functions.php
function wc_format_dimensions( $dimensions ) { $dimension_string = implode( ' × ', array_filter( array_map( 'wc_format_localized_decimal', $dimensions ) ) ); if ( ! empty( $dimension_string ) ) { $dimension_string .= ' ' . get_option( 'woocommerce_dimension_unit' ); } else { $dimension_string = __( 'N/A', 'woocommerce' ); } return apply_filters( 'woocommerce_format_dimensions', $dimension_string, $dimensions ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |