• Resolved klaus_hh

    (@klaus_hh)


    Hi there,
    just notice that the country list (behind the extra field “Country” is not up to date. I.e. there is “Serbia-Montenegro” which does not exists since years.
    How can I edit the list?
    Thanks a lot.
    Klaus

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sourov Amin

    (@sourov)

    Hello,

    Thank you for noticing. We will fix that ASAP and add the modified countries list in the next release. But you can use the filter hook user_meta_countries_list to edit the list where array $countries is to be modified with Country Code as the key and Country Name as the value.

    Thanks.

    Thread Starter klaus_hh

    (@klaus_hh)

    Sorry, but that is way to high for me. Where would I find that array?
    Regards

    Plugin Author Sourov Amin

    (@sourov)

    Hello,

    You need to add some codes, something like below in the function.php or in a plugin file.

     add_filter( 'user_meta_countries_list', 'my_country_list_modification', 10, 1 );
     
     function my_country_list_modification( $countries ){
        // To delete countries from the list (deleting Serbia and Montenegro)
        $countries = array_diff( $countries, ['Serbia and Montenegro'] );
        
        // To add new countries to the list (adding New Country 1 & 2)
        $countries['KEY1'] = 'New Country 1';
        $countries['KEY2'] = 'New Country 2';
        
        // Do other codes based on your needs
        
        return $countries;
     }

    If you find this complicated, then just wait a bit for the next Development release. We will modify the list there.

    Thread Starter klaus_hh

    (@klaus_hh)

    Worked fine, thanks.

    The new countries are shown at the end of the list, but that will do until the next update.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Country list not up to date’ is closed to new replies.