説明
について wpforms_currencies
WPFormsの設定で利用可能な通貨オプションです。 WPForms " 設定 " 支払いにある。 通貨 ドロップダウン・フィールド)。
パラメータ
- 通貨
- (配列) (必須)対応する通貨オプション。通貨の種類ごとの詳細も含みます。
ソース
wpforms/includes/functions/payments.php
詳細情報
について wpforms_currencies
フィルタはサポートされている通貨のリストを提供します。
バージョン1.2.6以降、WPFormsは通貨のドロップダウンフィールドで複数の通貨をサポートしています。
例
をカスタマイズしてください。 decimals
WPFormsの支払いアドオンでは、どの通貨の位置付けでも通貨が壊れる可能性があります。決済処理は小数点以下の値を無視します。
/** * Filters a list of supported currencies. * * @link https://wpforms.com/developers/wpforms_currencies/ * * @param array $currencies Supported currency options, including the details for each type of currency. * * @return array */ function wpf_dev_currencies( $currencies ) { $currencies = array( 'USD' => array( 'name' => esc_html__( 'U.S. Dollar', 'wpforms' ), 'symbol' => '$', 'symbol_pos' => 'left', 'thousands_separator' => ',', 'decimal_separator' => '.', 'decimals' => 2, ), ); return $currencies; } add_filter( 'wpforms_currencies', 'wpf_dev_currencies', 10, 1 );