• Resolved nadworks

    (@nadworks)


    Sorry for being an idiot, but how can we add more than one additional country using the below customisation?

    add_filter( 'gigpress_country_list', 'my_gigpress_country_list');
    
    function my_gigpress_country_list( array $gp_countries ) {
        // Add a country to the list:
    $gp_countries['XX'] = 'My Country';
    
        return (array) $gp_countries;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    Thanks for reaching out.

    The code below should work for adding more countries, with each value X1, X2 and X3 representing a different country:

    
    add_filter( 'gigpress_country_list', 'my_gigpress_country_list');
    
    function my_gigpress_country_list( array $gp_countries ) {
        // Add a country to the list:
    $gp_countries['X1'] = 'My Country 1';
    $gp_countries['X2'] = 'My Country 2';
    $gp_countries['X3'] = 'My Country 3';
    
        return (array) $gp_countries;
    }
    

    Please try it out and let me know if it works for you.

    Best regards,

    Marho

    Plugin Contributor András Guseo

    (@aguseo)

    Since this thread has been silent for almost a month I’m going to mark it as resolved. If you need help with this in the future, please open a new thread.

    Cheers,
    Andras

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘adding multiple additional countries’ is closed to new replies.