Hi,
Thank you for contacting us and I'd be happy to assist.
I'm afraid, this feature is not available out-of-the-box, but you're welcome to submit a feature request for it, at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
A workaround can be to use a custom user field and a user edit form to allow users to save a specific search if or when needed.
Note: For this approach to work, it is important that your view's search form is not set to update results using AJAX and the page is reloaded with each search.
1. You can add a new user field named "User Searches" and set it to have multiple instances, using the "Allow multiple instances of this field" option.
Example screenshot: hidden link
( ref: https://toolset.com/documentation/user-guides/custom-content/user-fields/ )
2. Next, you can create a user edit form and set it to edit an existing user.
Example screenshot: hidden link
3. That form will need only one hidden field, with field slug "current-query-string" and default field value as "[get_current_query_string]".
Example screenshot: hidden link.
3. You'll also need to register a custom shortcode that can get the search query filter parameter part from the current URL and use it as a value of the hidden field, mentioned in the last step:
add_shortcode('get_current_query_string', 'get_current_query_string_fn');
function get_current_query_string_fn() {
return $_SERVER['QUERY_STRING'];
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.
4. You'll also need to attach a custom function to "cred_save_data" hook, which can save the search query filters from the hidden field as a value of the custom user field "User Searches".
( ref: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data )
Example:
add_action('cred_save_data', 'my_save_data_action_user',10,2);
function my_save_data_action_user($new_user_id, $form_data)
{
if ( ($form_data['id']==123) && (!empty($_POST['current-query-string'])))
{
add_user_meta($new_user_id, 'wpcf-user-searches', $_POST['current-query-string']);
}
}
Please replace 123 with the actual ID of your user form, and again the above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.
5. The last step would be to include this new form, above or below the search form of your view.
The final outcome would be that the user will perform a search and if he/she would like to save it for later use, the submit button for the user form can be clicked and that search's query string will be saved.
You'll be able to show these saved search query strings from the user custom field, using the Type Fields API:
https://toolset.com/documentation/customizing-sites-using-php/functions/
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar