WordPress.org

Ready to get started?Download WordPress

Forums

Countries
Needs more Standard Data. (2 posts)

3 stars
  1. Hugh
    Member
    Posted 1 year ago #

    First I think this plugin is an awesome idea... Second, it could afford some improvements.

    Drupal as a module which does something simular - providing a list of countries - for other modules to access... So, it seems to be an efficient way to work as a developer...

    I think the plugin could be improved by doing three things:

    1. Adding more data on install. Absent from the standard data is the UN regions http://www.commondatahub.com/country_source.jsp
    2. There is also no documentation saying which list of countries is being used. Is it ISO 3166 and if so current as of what data? - there are also social lists like this one on github which could be used... http://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv
    3. It would be nice, cool, useful in some cases, to have multiple names for countries, like per language as can be found here: http://en.wikipedia.org/wiki/List_of_country_names_in_various_languages
      .

    I am not sure why this was implemented as a CPT. (I am not saying that is it a bad way to do it - I just don't know.) It seems to me that if people are going to use countries that they are going to want to associate them with another CPT... This I think is the role of a taxonomy. But then if the countries are a taxonomy and we have all this other data about the country then the taxonomy needs custom fields for each term... And if I understand things then that dynamic starts to look awkward - in a WordPress kind of way.

    The challenge for me in WP using this plugin has been that I need the countries to work as a taxonomy. So, I found http://wordpress.org/extend/plugins/cpt-onomies/ to work with the custom post types and "taxonomize" the CPT. The problem is that it is a hog... that is when I do it this way then it takes some time for my processor to find the correct countries. (If this is not a best practice way of working, someone tell me and show me the light... ) I am also using ACF and using the above set-up with that.... I just wish I could have a Chosen interface rather than the ACF one....

    the only next thing I could wish for would be a plugin like this which allowed for the use of ISO 639-3 language codes, kinda like this one did...

  2. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for the feedback.

    Just a little info about why CPT, not taxonomy.
    It's mainly down to the amount of data that we may want to associate with a country and that it is more flexible to store this as a CPT as taxonomy meta isn't really supported by WordPress that well - it's best to think of a taxonomy as just a way of grouping posts and CPT for more data-oriented objects.

    For example, if you want to relate a post or other CPT to a country you could use the plugins you mention above or the posts 2 posts plugin which is an excellent for relating a CPT to another CPT.

    Also it is much easier to query a CPT by meta data etc.

    Adding ISO 639-3 language codes as meta data should be fairly straightforward and will probably be something that is added at some point.

    We're quite happy to receive code patches and suggestions.
    I have posted the code on GitHub if people prefer to contribute in that way:
    https://github.com/benhuson/countries

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.