Answers for "Only Show Specific Countries In Caldera Forms Phone Field"

PHP
0

Only Show Specific Countries In Caldera Forms Phone Field

<?php
/**
 * Show only specific countries' flag in Caldera Forms phone fields
 */
add_filter( 'caldera_forms_phone_js_options', function($options ){
	$options[ 'onlyCountries' ] = array( 'cn', 'tw' );
	return $options;
});
Posted by: Guest on June-29-2021
0

Change Initial Country For Caldera Forms Phone Fields

<?php
/**
* Set intiial country for Caldera Forms phone fields
*/
add_filter( 'caldera_forms_phone_js_options', function( $options){
	//Use ISO_3166-1_alpha-2 formatted country code
	$options[ 'initialCountry' ] = 'CH';
	return $options;
});
Posted by: Guest on June-29-2021

Code answers related to "Only Show Specific Countries In Caldera Forms Phone Field"

Browse Popular Code Answers by Language