Description

Filters currency options available in WPForms Settings (listed under WPForms » Settings » Payments, in the Currency dropdown field).

Parameters

$currencies
(array) (Required) Supported currency options, including the details for each type of currency.

Source

pro/includes/payments/functions.php

More Information

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.

Examples

If you don’t need the multiple currency and only want to allow for 1 currency to show, add this function to your site to filter out the other currency options.

/**
 * Filters a list of supported currencies.
 * 
 * @link   https://wpforms.com/developers/wpforms_currencies/
 *
 * @param  array $currencies
 * @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 );