Filtering City/States out with no current events

Home Forums Calendar Products Filter Bar Filtering City/States out with no current events

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1150200
    Amal
    Participant

    On our site we listed some test events. We then deleted those events. On the site (https://france-amerique.com/event) you can see a city “Breuillet” that is from an event I created as a test. The event was deleted but the city is still showing up in the select, of course returning an empty search…

    Is there a way to programmatically filter out cities that do not have active events?

    #1150371
    Brook
    Participant

    Howdy Amal,

    I would love to help you with this.

    The easiest way to trim that list would be to delete the test venue you created. If you go to WP-Admin > Events > Venues, find the Breuillet venue, and delete it, it should disappear from the front end.

    If yoou wish to truly filter all venues with no event dynamically, you definitely could. But it will require a goodly measure of programming. If I were you i would extend the class Tribe__Events__Filterbar__Filters__City. Then you could add in your filtering code there, overriding any parent code you need to to facilitate the shorter list. Instantiate this new class of yours, and it will automatically add itself as a Filter Bar option in WP-Admin > Events > Settings > Filters. You can then change your settings on that page to show this new City filter instead of the old one.

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!

    – Brook

    #1158883
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Filtering City/States out with no current events’ is closed to new replies.