wc_get_price_thousand_separator
Дозволяє змінити роздільник тисяч для цін.
Використання
add_filter( 'wc_get_price_thousand_separator', 'wp_kama_wc_get_price_thousand_separator_filter');
/**
* Function for `wc_get_price_thousand_separator` filter-hook.
*
* @param $option
*
* @return
*/
function wp_kama_wc_get_price_thousand_separator_filter( $option ){
// Filter...
return $option;
}- $option
- Розділювач, збережений у адмінці.
Приклади
#1 Змінимо роздільник
add_filter( 'wc_get_price_thousand_separator', 'change_price_thousand_separator' );
function change_price_thousand_separator(){
return '';
}
echo wc_price(15000); //> 15 000
список змін
| З версії 2.3 | Введено. |
Де викликається хук
wc_get_price_thousand_separator
woocommerce/includes/wc-formatting-functions.php 516
return stripslashes( apply_filters( 'wc_get_price_thousand_separator', get_option( 'woocommerce_price_thousand_sep' ) ) ));
Де використовується хук у WooCommerce
Використання не знайдено.
