Skip Navigation

[Resolved] default search term in filter not working

This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2101467

Trying to limit the number of posts the view returns when the page (containing the view) is called without a URL parameter

Pretty standard filter:
wpv-filter-start hide="false"]
[wpv-filter-controls]
[wpml-string context="wpv-views"]<b>email:</b> [/wpml-string]
[wpv-control-postmeta type="textfield" field="wpcf-email" output="legacy" auto_fill_default="cjstumpf@gmail.com" url_param="email"]
[wpv-filter-submit output="bootstrap" class="btn-secondary"][wpv-filter-reset output="bootstrap"][wpv-filter-spinner spinner="hidden link"][/wpv-filter-spinner]

hidden link

I expected the default email address would have been applied
Also, same issue if SUBMIT with a blank email field or RESET

Thank you, BTW excellent support in every case I've submitted

#2101937

Hello,

The "auto_fill_default" attribute is for "text to be displayed as the default option", it won't apply any parameter to the query.

In your case, you can try wpv_filter_query filter hook, and change the query of views, see our document:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

And similar thread:
https://toolset.com/forums/topic/set-default-value-in-a-select-box-search/#post-452500