WordPress.org

Forums

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

  1. owcv
    Member
    Posted 2 years 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 2 years ago #

    you can try to hook into em_get_countries filter.

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    untested, but try:

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

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

  5. agelonwl
    Member
    Posted 2 years ago #

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

  6. owcv
    Member
    Posted 2 years ago #

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

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

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

  8. owcv
    Member
    Posted 2 years ago #

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

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years 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 2 years ago #

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

  11. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years 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 2 years ago #

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

  13. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    the latest update fixes this issue

  14. owcv
    Member
    Posted 2 years ago #

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

  15. owcv
    Member
    Posted 2 years ago #

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

  16. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

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

  17. owcv
    Member
    Posted 2 years 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 2 years ago #

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

  19. owcv
    Member
    Posted 2 years ago #

    Good news and big thanks again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic