Forums › Forums › Search & Filter Pro › Save current_query to use later on
Tagged: V3
- This topic has 3 replies, 3 voices, and was last updated 4 years ago by Ross.
-
Anonymous(Private) December 11, 2020 at 1:50 pm #269562
Hello,
At the moment i am building a website where people can filter posts. Once filtered it is the intention that it should be possible for people to leave their emailadress. Once they do that i save the “$sf_current_query->get_search_term()” and “$sf_current_query->get_array()” to the database to make it possible to repeat the query.
Would it be possible to use the saved data to query the results later on? if so with which function? I already tried “set_field_values_array()” but i cannot get it to work.
The results do not need to be filtered, i just want to check if there are any results afterwords with WP_Query.
Hope that you can help me with the above, thanks in advance!
Ross Moderator(Private) December 15, 2020 at 9:40 am #269828Hi Cliff
Right now there is not a simple way to do it.
In v3, we’ll be adding rest api endpoints, so you can recreate queries yourself and do things with the results as you need via ajax.
And we’ll also likely add some PHP functions to make it easier to interact with our queries too..
But for now, the only way I could think of it is to save the users URL (or recreate it using saved query parameters) and do a
wp_remote_get
– and handle things that way – it would be inefficient though as it would load the whole page (as opposed to query the query results).I hope that helps for now.
Best
-
AuthorPosts