Resumo de IA
Descrição
The wpforms_currencies filters currency options available in WPForms Settings (listed under WPForms » Settings » Payments, in the Currency dropdown field).
Parâmetros
- $currencies
- (array) (Required) Supported currency options, including the details for each type of currency.
Fonte
wpforms/includes/functions/payments.php
Mais Informações
The wpforms_currencies filter provides a list of supported currencies.
Since version 1.2.6, WPForms has supported multiple currencies for the Currency dropdown field.
Exemplos
Please note, customizing the decimals positioning of any currency could break the currency on any of the WPForms payment addon. The payment process would ignore the decimal values.
/**
* 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 );