Skip Navigation

[Resolved] Text search query variable

This support ticket is created 5 years, 11 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 3 replies, has 2 voices.

Last updated by Luo Yang 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1191733

Hi,

Wordpress default search bar's query variable is "s" and toolset's query variable for text search is "wpv_post_search".
Is it possible to change "?wpv_post_search=" to "?s=".

Regards

#1191801

Hello,

No, it is not possible, the URL parameter name to "s" is reserved by WordPress.

If you change the search URL parameter name to "s", it will conduct other unexpected result, for example, WordPress will take it as a built-in search result page,

So, it is not recommended to change the URL parameter name to "s".

#1192312

Hi,

I understand your answer but using layout create search result page archive, only display counter of records not contents. I consider that wordpress parameter name is different from toolset view's parameter name.

Is it possible for toolset text search view to receive parameter name "s"
.
Regards

#1192326

There isn't such a built-in feature, it needs custom codes, for example, you can use Views filter hook wpv_filter_query to trigger a PHP function, in this function customize view's query to what you want, see our document:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.