wc_price_args
Format the price with a currency symbol.
Использование
add_filter( 'wc_price_args', 'wp_kama_wc_price_args_filter' );
/**
* Function for `wc_price_args` filter-hook.
*
* @param float $price Raw price.
*
* @return float
*/
function wp_kama_wc_price_args_filter( $price ){
// filter...
return $price;
}
- $price(float)
- Raw price.
Где вызывается хук
woocommerce/includes/wc-formatting-functions.php 596-611
$args = apply_filters( 'wc_price_args', wp_parse_args( $args, array( 'ex_tax_label' => false, 'currency' => '', 'decimal_separator' => wc_get_price_decimal_separator(), 'thousand_separator' => wc_get_price_thousand_separator(), 'decimals' => wc_get_price_decimals(), 'price_format' => get_woocommerce_price_format(), 'in_span' => true, 'aria-hidden' => false, ) ) );