Home › Forums › Calendar Products › Filter Bar › How to include custom fields in search
- This topic has 10 replies, 3 voices, and was last updated 7 years, 8 months ago by Cliff.
-
AuthorPosts
-
August 3, 2016 at 5:43 am #1146975TateParticipant
Hi, we are a Events Calendar Pro user.
Our client wants to include Custom Fields in the Calendar Keyword Search. That is, in addition to searching the title, post body, and synopsis, we would like it to also search certain post_meta custom fields.Would you please direct me on how to do this?
August 3, 2016 at 10:13 am #1147189CliffMemberHi Tate. Our Filter Bar add-on can work with PRO’s Additional Fields functionality, but not regular post_meta / custom fields by default.
I didn’t find that as an existing feature request at our plugins’ UserVoice page.
Please do add your feature request there.
This allows others who are interested in that feature to easily voice their support. We frequently review suggestions there to find out which ones are popular, then we implement as many of them as we can.
Once you post it, feel free to link to it from here in case anyone comes across this forum thread in the future.
If you need some coding help to customize Tribe Bar (the default search bar) or Filter Bar, you may want to ask your developer or reference our documentation and list of known customizers.
August 4, 2016 at 7:30 am #1147532TateParticipantThank you for your reply. I have added The Event Calendar’s Additional Fields, and created a custom field through that. However, it is not included in the keyword search. Can you please direct me on how to have this field included in the keyword search? I am a programmer, so am comfortable writing code, if you can direct me on where and how to hook in.
For others reading this thread, I submitted a feature request here: Please vote for it!
https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/15543609-include-wp-post-meta-fields-in-keyword-searchAugust 4, 2016 at 9:26 am #1147593CliffMemberTate, to be clear, are you referring to PRO’s Additional Fields or WordPress’ custom fields?
If you’re talking about PRO’s Additional Fields, they are available via Filter Bar. Here’s a video demonstrating that: https://cl.ly/1N301c3h332y
However, if you’re wanting the free-form search box in either the Tribe Bar or the Filter Bar to include results from PRO’s Additional Fields and/or WordPress’ custom fields, that functionality does not exist. If this is what you’re wanting, you might want to re-word your UserVoice idea to be more explicit in this regard.
August 5, 2016 at 7:07 am #1148119TateParticipantGot it. Yes, I am looking for the keyword search (free-form search box) in the filter bar to include custom fields (at least from PRO, but WP would be nice also) in its search.
Do you know of a way I can adjust the plugin code itself to make this happen? I was unable to locate the pertinent parts of the keyword (free form) search logic. Would you be able to direct me at least to where those parts are located?
August 5, 2016 at 7:52 am #1148154CliffMemberOur Tribe Bar search just runs the regular WordPress search but restricts to just searching events. Therefore, you mIgot want to look into modifying WordPress default search, possibly using this as a reference: https://codex.wordpress.org/Custom_Queries#Keyword_Search_in_Plugin_Table
August 5, 2016 at 7:52 am #1148155CliffMemberOur Tribe Bar search just runs the regular WordPress search but restricts to just searching events. Therefore, you mIgot want to look into modifying WordPress default search, possibly using this as a reference: https://codex.wordpress.org/Custom_Queries#Keyword_Search_in_Plugin_Table
August 5, 2016 at 7:52 am #1148156CliffMemberOur Tribe Bar search just runs the regular WordPress search but restricts to just searching events. Therefore, you might want to look into modifying WordPress default search, possibly using this as a reference: https://codex.wordpress.org/Custom_Queries#Keyword_Search_in_Plugin_Table
August 9, 2016 at 4:08 pm #1149767TateParticipantThank you. I was able to accomplish exactly what I wanted by following the instructions here:
Copying and adjusting that code worked great. For anyone viewing this later, be aware that the if line should read:
if ( is_search() || !empty( $_REQUEST['tribe-bar-search'] ) ) {
So it runs for both WP search, and the Tribe Events Calendar search.Thanks again for your help!
August 9, 2016 at 7:34 pm #1149821CliffMemberExcellent. Thanks for sharing for others in the future as well!
-
AuthorPosts
- The topic ‘How to include custom fields in search’ is closed to new replies.