Home › Forums › Calendar Products › Events Calendar PRO › Search parameter in tribe_get_events
- This topic has 3 replies, 2 voices, and was last updated 6 years, 8 months ago by Emmanuel.
-
AuthorPosts
-
July 17, 2017 at 2:34 am #1322023EmmanuelParticipant
Hi,
We are currently building a filter box for our calendar, and we are encountering an issue.
We are using tribe_get_events to fetch events between two dates, and we need to add a search string in our search.
But when we add a ‘s’ parameter, the query return an empty result.
$query = array(
‘eventDisplay’ => ‘custom’,
‘start_date’ => $year_start.’-01-01 00:01′,
‘end_date’ => $year_start.’-12-31 23:59′,
‘s’ => $search,
);
tribe_get_events($query);The query without the ‘s’ parameter is working as expected.
We tried a standard WP_Query, with only ‘s’ and ‘post_type’ as parameters, and it was working fine.What have we done wronge ?
Regards,
Cam
July 18, 2017 at 11:54 am #1322833JenniferKeymasterHi Cam,
Thanks for reaching out! I’m sorry you’re not able to get the search parameter to work with tribe_get_events, as it should indeed work.
I do want to note that WP search only looks at the post title, excerpt, and content, not at any of the custom fields. Could it be that you are using terms that are only found in custom fields, and do not appear in any of the applicable events’ default fields (title, excerpt, post)?
I would recommend doing a quick search with a term that you know is in a default field of at least one event and see if you are able to get any results.
Let me know how it goes!
Thanks,
Jennifer
August 9, 2017 at 9:35 am #1332877Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Search parameter in tribe_get_events’ is closed to new replies.