only show specific countries in caldera forms phone field

Solutions on MaxInterview for only show specific countries in caldera forms phone field by the best coders in the world

showing results for - "only show specific countries in caldera forms phone field"
Noemi
25 May 2017
1<?php
2/**
3 * Show only specific countries' flag in Caldera Forms phone fields
4 */
5add_filter( 'caldera_forms_phone_js_options', function($options ){
6	$options[ 'onlyCountries' ] = array( 'cn', 'tw' );
7	return $options;
8});
Lotta
04 Jun 2019
1<?php
2/**
3* Set intiial country for Caldera Forms phone fields
4*/
5add_filter( 'caldera_forms_phone_js_options', function( $options){
6	//Use ISO_3166-1_alpha-2 formatted country code
7	$options[ 'initialCountry' ] = 'CH';
8	return $options;
9});