I want to remove a specific country from address.
I found the currency for the country but did not find the php code for country and phone to remove it.
any help please
Hi @ahmadzkhaled,
Thank you for reaching out to us and I hope you are doing good today.
The following code snippet can help with removing a country from the list.
function wpmudev_filter_countries( $countries ){
foreach ($countries as $key => $value) {
if( $value ['value'] == 'KR' ){ //check if the country is Republic of South Korea
unset($countries[$key]); //Remove the country from the list
}
}
return $countries;
}
add_filter( 'forminator_countries_field', 'wpmudev_filter_countries', 10, 1 );
I hope that helps you to proceed further.
Kind Regards,
Nebu John
is there also an option to have only one or two countries available.
i want to driver service only in germany, so need only one country.
kindly
aadursun
Hi @aadursun
I hope you are doing well.
You can update the country list using this script
https://gist.github.com/patrickfreitasdev/18c62c914281e8aff29e49ad55bb417a
Add it as a mu-plugin following this guide https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins But another solution without custom code is disabling the Country field and using a regular Select field instead https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#select-field
Best Regards
Patrick Freitas