Help Desk

How can I change the Venue Filter to show the City or State field?

  • Posts: 4 Topics: 2
    | Permalink

    Hi,
    I’m publishing events all over the country (Spain), so the Venue Filter is not exactly what I need, the way it shows now it’s not very useful for the users, I’d like to modify it to show the City or State field.
    Could you tell me how can I do it?

    Thanks!

    Posts: 4809 Topics: 3 Answers: 6
    | Permalink

    Howdy begulliver,

    TEC filters have been designed from the ground up with this sort of extensibility in mind. So basically each filter is an instance of the new TribeEventsFilter class. To add a new TEC filter you would want to extend that class. Since it sounds like what you want to do will be similar to the Venue Filter in a most ways, check out \the-events-calendar-filterbar\lib\filters\TribeEventsFilter_Venue.php.

    Once you have created your TEC filter you would need to attach it. How I would do it is by adding my TEC filter to the tribe_events_all_filters_array. That is WP filter that you can hook into with add_filter. Simply add your TEC filter to the end of that array and return.

    We do not have our documentation up yet. That should be easy enough if you do not mind jumping into the middle of some PHP. Please let me know if that helped or if you have any more questions. Thanks!

    – Brook

    Posts: 4 Topics: 2
    | Permalink

    Hi Brook!

    We extended the TribeEventsFilter class, based on the Venue filter, but we can’t see where exactly that class has to be attached to: you said we have to add it to the tribe_events_all_filters_array but we can’t find it… Where do we have to look for?

    Thanks a lot!

    Posts: 4809 Topics: 3 Answers: 6
    | Permalink

    Howdy begulliver,

    This might be a bit confusing, since I will be referring to Tribe Filters and WordPress Filters… similar names, but of course very different purposes. So we add all Tribe filters to an array, then run that array through a WP filter called ‘tribe_events_all_filters_array’. You would want to hook into the WP filter using add_filter(), then return an array with your new filter added. You could examine our code on \lib\tribe-filter.class.php on lines 93 &  365-375 to get an idea of what that array contains and what is expected. Or, you could just perform a var_dump of the array and take it from there.

    Again I wish we had a bit better documentation on this. If another issue crops up once you have figured out the array and added your filter please let me know. I would like to make sure my instructions for this are clear so that both you and anyone in the future who wants to do this is able. Thanks!

    – Brook

    Posts: 4 Topics: 2
    | Permalink
    This reply has been marked as private.
    Posts: 4809 Topics: 3 Answers: 6
    | Permalink

    Hello again Begulliver,

    I do appreciate your polite candor. I can definitely understand where you are coming from.

    All refunds are processed through the email address pro@tri.be. The only way to obtain a refund is by requesting it from that channel. Definitely include a good explanation of why you want a refund, and feel free to link to these topics as well.

    At any point if you want me to continue helping guide you through this customization, I would be happy to help. I just need to know what the specific problem is that you are currently facing.

    If there is anything I can do to be more helpful, or any tips you have for us on how we could improve the plugin for folks like you, please let us know. I am eager to hear your feedback if you are willing to offer it. Thanks!

    – BROok