Automattic\WooCommerce\Blocks\Assets

AssetDataRegistry::get_currency_data()protectedWC 1.0

Get currency data to include in settings.

Метод класса: AssetDataRegistry{}

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_currency_data();

Код AssetDataRegistry::get_currency_data() WC 8.7.0

protected function get_currency_data() {
	$currency = get_woocommerce_currency();

	return [
		'code'              => $currency,
		'precision'         => wc_get_price_decimals(),
		'symbol'            => html_entity_decode( get_woocommerce_currency_symbol( $currency ) ),
		'symbolPosition'    => get_option( 'woocommerce_currency_pos' ),
		'decimalSeparator'  => wc_get_price_decimal_separator(),
		'thousandSeparator' => wc_get_price_thousand_separator(),
		'priceFormat'       => html_entity_decode( get_woocommerce_price_format() ),
	];
}