• Resolved chrissypeng

    (@chrissypeng)


    Hi there,
    I am currently using Ultimate Member to create a login system on my website, and I’ve encountered an issue with the country field. Instead of using the plugin’s pre-defined list of countries, I have entered custom country names in the country field. However, I’ve noticed that when my custom country names do not match the plugin’s default values, the country field does not appear in the Member Directories.

    Could you please advise on how to resolve this issue? I would like to ensure that the country field, with my custom values, is displayed correctly in the Member Directories. Is there any way to bypass the default country list or map my custom country names to the plugin’s values?

    Thank you in advance for your support!

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support yuriinalivaiko

    (@yuriinalivaiko)

    Hello @chrissypeng

    The predefined field “Country” uses country codes as keys. You can not change options in this field as a simple code. Use the um_countries_predefined_field_options hook in your custom code if you want to rename a country or add a country.

    Note: use a valid country code for the custom country – Alpha-2 code in ISO 3166.

    Code example:

    // Extend predefined Country field options.
    add_filter( 'um_countries_predefined_field_options', function( $array ) {

    $array['US'] = __( 'United States of America', 'ultimate-member' );
    $array['XX'] = __( 'Custom Country', 'ultimate-member' );

    return $array;
    } );

    Regards

    Plugin Support andrewshu

    (@andrewshu)

    Hi @chrissypeng

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.