Forums Forums Search & Filter Pro Save current_query to use later on

Tagged: 

  • This topic has 3 replies, 3 voices, and was last updated 4 years ago by Ross.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #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!

    Trevor
    #269632

    This might be a possibility in V3 of our plugin, due in the New Year, but I do not think so with our current plugin, sorry. even then, I am not sure it will be possible.

    Trevor
    #269634

    I have referred your question to our plugin developer, Ross, for his input.

    Ross Moderator
    #269828

    Hi 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

Viewing 4 posts - 1 through 4 (of 4 total)