Home › Forums › Calendar Products › Filter Bar › Creating additional filter bar items based on "Additional Filters" information
- This topic has 4 replies, 3 voices, and was last updated 10 years, 8 months ago by
Support Droid.
-
AuthorPosts
-
July 27, 2015 at 8:03 am #990536
activeyouth
ParticipantWe used the code on this page http://pastebin.com/30mZSeKk and it did add a “Taxonomy” item to the filterbar, however, how do we change the data that’s being pulled in to reflect items in the “Additional Filters” area instead of “Taxonomy”?
If you could provide a code sample, that would be very helpful.
Thank you,
DawnJuly 27, 2015 at 3:00 pm #990747Barry
MemberHi Dawn,
Looks like you’ve made a great start!
Please note, however, that when it comes to custom development tasks the amount of support we can offer up is – regrettably – somewhat limited.
how do we change the data that’s being pulled in to reflect items in the “Additional Filters” area instead of “Taxonomy”?
I feel like I’m missing some context, here … when you speak of “Additional Filters” what are you referring to?
July 27, 2015 at 3:21 pm #990756activeyouth
ParticipantIt’s the additional fields that you can set up as a feature of events calendar pro.
You set them up by going to Events> settings>Additional Fields.
After these fields are set up and then selected when setting up an event, I want to be able to filter on them through the filter bar.
July 27, 2015 at 4:17 pm #990779Barry
MemberAh, I see – thanks for clarifying 🙂
So Event Calendar PRO’s additional fields are, ultimately, stored pretty much the same way as are regular WordPress custom fields – and so you can take advantage of meta/custom field queries here – but there is a slight difference in that the meta key for these fields usually follow this sort of form:
_ecp_custom_x
Where x is a number. To determine which number exactly for any given field, your code would need to load the current “map” via:
tribe_get_option( 'custom-fields' );
You should get back something like this:
[ 1 => [ 'name' => '_ecp_custom_1', 'label' => 'Nearest town', ... ], 2 => [ 'name' => '_ecp_custom_2', 'label' => 'Age restriction', ... ], ... ]Armed with this information, your own custom filter can – through the setup_query_args() method – apply some custom field queries to match whatever has been specified by the current user.
I hope that gives you some ideas – and good luck with the customization 🙂
August 11, 2015 at 7:05 am #995072Support 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 ‘Creating additional filter bar items based on "Additional Filters" information’ is closed to new replies.
