wc_format_price_range()
Format a price range for display.
Hooks from the function
Return
String
.
Usage
wc_format_price_range( $from, $to );
- $from(string) (required)
- Price from.
- $to(string) (required)
- Price to.
wc_format_price_range() wc format price range code WC 9.6.1
function wc_format_price_range( $from, $to ) { /* translators: 1: price from 2: price to */ $price = sprintf( _x( '%1$s – %2$s', 'Price range: from-to', 'woocommerce' ), is_numeric( $from ) ? wc_price( $from ) : $from, is_numeric( $to ) ? wc_price( $to ) : $to ); return apply_filters( 'woocommerce_format_price_range', $price, $from, $to ); }