formatted_woocommerce_price

The WooCommerce formatted woocommerce price hook.

Description

apply_filters( 'formatted_woocommerce_price', (number) $number_format, (unknown) $price, (unknown) $decimals, (unknown) $decimal_separator, (unknown) $thousand_separator ); 

Parameters (5)

0. $number_format (number) => number_format( $price, $decimals, $decimal_separator, $thousand_separator )
The number format.
1. $price (unknown)
The price.
2. $decimals (unknown)
The decimals.
3. $decimal_separator (unknown)
The decimal separator.
4. $thousand_separator (unknown)
The thousand separator.

Usage

To run the hook, copy the example below.
  1. $number_format = apply_filters( 'formatted_woocommerce_price', $number_format, $price, $decimals, $decimal_separator, $thousand_separator ); 
  2.  
  3. if ( !empty( $number_format ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the formatted_woocommerce_price callback 
  2. function filter_formatted_woocommerce_price( $number_format, $price, $decimals, $decimal_separator, $thousand_separator ) { 
  3. // make filter magic happen here... 
  4. return $number_format
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'formatted_woocommerce_price', 'filter_formatted_woocommerce_price', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'formatted_woocommerce_price', 'filter_formatted_woocommerce_price', 10, 5 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/wc-formatting-functions.php  
  1. $price = apply_filters( 'formatted_woocommerce_price', number_format( $price, $decimals, $decimal_separator, $thousand_separator ), $price, $decimals, $decimal_separator, $thousand_separator );