wc_get_price_thousand_separatorхук-фильтрWC 2.3

Позволяет изменить разделитель тысяч для цен.

Разделитель также можно изменить через админку:
WooCommerce->Настройки->Основные->Настройки валюты

Использование

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
Разделитель, сохранённый в админке.

Примеры

0

#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()
wc_get_price_thousand_separator
woocommerce/includes/wc-formatting-functions.php 518
return stripslashes( apply_filters( 'wc_get_price_thousand_separator', get_option( 'woocommerce_price_thousand_sep' ) ) );

Где используется хук в WooCommerce

Использование не найдено.