WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Alphabetical order of countries in localized versions (19 posts)

  1. owcv
    Member
    Posted 1 year ago #

    I use the german localization of Events Manager and the order in which countries are shown seems to be after the english alphabet. Can you also make this work for the german and other localized versions?

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    you can try to hook into em_get_countries filter.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    untested, but try:

    function my_countries_mod($countries){
    return sort($countries);
    }
    add_filter('em_get_countries','my_countries_mod');
  4. owcv
    Member
    Posted 1 year ago #

    But that is not update-safe. Will this be fixed in the next version?

  5. agelonwl
    Member
    Posted 1 year ago #

    EM won't remove that if you put it in your theme functions.php

  6. owcv
    Member
    Posted 1 year ago #

    But wouldn't it be better if EM supports that from the core?

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    yes but ideally a lot of stuff would be, so for now you can use this ;)

  8. owcv
    Member
    Posted 1 year ago #

    I've tested the function mentioned above, but now my country-selector is blank... :-(

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    oops,

    function my_countries_mod($countries){
    sort($countries);
    return $countries;
    }
    add_filter('em_get_countries','my_countries_mod');

    that should work

  10. owcv
    Member
    Posted 1 year ago #

    I'm sorry but it does not. The selector is still empty then.

  11. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    what about just

    function my_countries_mod($countries){
    return $countries;
    }
    add_filter('em_get_countries','my_countries_mod');

    without any sorting? if not then maybe you're doing something wrong somewhere else.

  12. owcv
    Member
    Posted 1 year ago #

    That works, but as you said, with no sorting.

  13. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    the latest update fixes this issue

  14. owcv
    Member
    Posted 1 year ago #

    Great, it works! Thank you so much for your efforts!

  15. owcv
    Member
    Posted 1 year ago #

    Will the order also be fixed in the backend with one of the next updates?

  16. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    Where in the backend are you seeing this problem? If it exists, then we'll fix it asap too.

  17. owcv
    Member
    Posted 1 year ago #

    When you edit a single event and choose the country under location. There the countries where not hierarchical in german version.

  18. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    you're right... didn't notice because it's ordered by default in English. will fix.

  19. owcv
    Member
    Posted 1 year ago #

    Good news and big thanks again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic