Home › Forums › Calendar Products › Events Calendar PRO › Add a custom filter
- This topic has 2 replies, 3 voices, and was last updated 10 years, 1 month ago by
Support Droid.
-
AuthorPosts
-
March 9, 2016 at 3:53 am #1086583
Thibault
ParticipantHello,
I’m trying to add a custom filter (EventCountry) in my FilterBar.
I found some threads but they are not helping. All of them are outdated (3.X) though.What I did so far:
/src/Tribe/Filters/Venue.php has been duplicated in Country.php
Class name has been changed accordingly. I change the meta_key occurences in SQLs to “_VenueCountry”.In functions.php :
add_filter( 'tribe_events_all_filters_array', 'custom_add_filter_callback' ); function custom_add_filter_callback( $filters ) { $filters['Country'] = array( 'name' => 'Country', 'type' => 'select', ); return $filters; }This add a new filter in admin area. I don’t know what to specify in admin_form. This should call that function in Country.php but it actually doesn’t.
new Tribe__Events__Filterbar__Filters__Country( sprintf( __( '%s Country', 'tribe-events-filter-view' ), tribe_get_event_label_singular() ), 'country' );
Placed in my functions.php, this adds automatically an “Events Country” on the right side in admin filterbar area.
Admin Form is loaded but Parameters like Title and so on aren’t saved.None of those two ways will display anything on the front end.
Can you point me to a solution ?
Thanks
March 10, 2016 at 2:18 pm #1087469Brian
MemberHi,
Thanks for using our plugins. I can try to help out here, but I am limited in supporting customizations.
Per our terms and conditions we support features of the plugins and although we try to help get you started on customizations for the most part you are going to have to take it on to complete.
I do not have any resources on how to add a filter.
However, they maybe a way to do this without coding.
With 4.0 you can create an Additional Field in Pro for Country and then add that to the filter bar to sort.
You can read about that here:
Do you think you could get that to work?
March 25, 2016 at 9:35 am #1094109Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Add a custom filter’ is closed to new replies.
