WordPress.org

Support

Support » Plugins and Hacks » Custom Content by Country (by iControlWP) » [Resolved] United Kingdom is "UK" not "GB"

[Resolved] United Kingdom is "UK" not "GB"

  • 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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Paul G.

    @paultgoodchild

    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.

    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.

    Plugin Author Paul G.

    @paultgoodchild

    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’.

    Plugin Author Paul G.

    @paultgoodchild

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] United Kingdom is "UK" not "GB"’ is closed to new replies.
Skip to toolbar