How can I set a default country code for social links extension such as whatsapp, viber.
Thank you
Hi,
Please try this PHP snippet (this snippet set the default country USA for WhatsApp):
add_filter( 'hivepress/v1/models/listing/attributes', 'custom_hp_set_countries', 1000 );
add_filter( 'hivepress/v1/models/vendor/attributes', 'custom_hp_set_countries', 1000 );
function custom_hp_set_countries($attributes){
if(isset($attributes['whatsapp'])){
$attributes['whatsapp']['edit_field']['country'] = 'US';
}
return $attributes;
}
Thank you andrii
Is the same for viber? I just the change whatsapp text to viber ya?
Hi,
Yes, you can just change whatsapp to viber.
How to I change the initial selected Afghanistan phone number/country code to a specific country as a default for my users, so the majority of my users will not need to scroll all the way from (A to Z)?
Thanks in advance
Hi,
Please check the solution in this topic.
Hi I tried the recommended snippet without result please assist
Hi,
Please provide an example of the code you are using and we will try to help.