WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content by Country (by iControlWP)
[resolved] United Kingdom is "UK" not "GB" (5 posts)

  1. jodamo5
    Member
    Posted 2 months ago #

    Hi. I've just found that the United Kingdom responds to the two-letter code "UK" not "GB".

    I inserted the country name with the [CBC_COUNTRY /] code and it said, "United Kingdom" but I had "GB" as the country and the content didn't appear. When I changed the country code to "UK" the content appeared.

    GB is listed on the ISO 3166 Country Codes list, but this plugin uses "UK".

    I just took a guess at "UK" and it worked. But to help with trouble shooting, it could be useful to have a shortcode like [CBC_COUNTRY_SHORT /] that would display the two-letter code. That would mean we could easily find the correct shortcodes if any others don't follow the ISO 3166 list.

    https://wordpress.org/plugins/custom-content-by-country/

  2. Paul G.
    Member
    Plugin Author

    Posted 2 months ago #

    After looking into this, I can see the long term fix is to change the data in the database that I'm referring to for the country codes. But if I do that, it'll break for a lot of people who have previously been using 'uk' for referencing visitors from the united kingdom. At the same time, I can't just do an automatic in-plugin conversion because it'll mess with Ukraine country code.

    I'm not sure why ip2nation has organized the data as it did.

    I'll have a think on this.

  3. jodamo5
    Member
    Posted 2 months ago #

    The code for Ukraine is UA according to the ISO 3166 list, so it shouldn't mess with Ukraine settings? http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

    But just a note on the FAQs page will probably suffice. That way you could leave it as is, and new users will know that United Kingdom is UK.

  4. Paul G.
    Member
    Plugin Author

    Posted 2 months ago #

    yep, the code for Ukraine is UA, but in the database data, if I change it to now use the column for which it is GB for the United Kingdom, in the same column for the Ukraine it's 'uk'.

  5. Paul G.
    Member
    Plugin Author

    Posted 2 weeks ago #

    Just to let you know, "gb" should now work as expected in the latest release v2.14.

Reply

You must log in to post.

About this Plugin

About this Topic