Skip Navigation

[Resolved] URL query parameter not showing custom input field

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

Last updated by Clifford 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1213480

I have a custom form input field and when Ajax is not enabled, it does appear as a URL query parameter. I then plan to filter the View's query logic accordingly.

However, if I enable Ajax, then it does NOT end up as a URL query parameter although the URL does get modified. It could be that it'll work once I add my custom code to filter Views' query logic, but I was wondering if there was a hook for adding my custom input to Views' "Query Filters" section settings.

Link to a page where the issue can be seen:
hidden link

#1213560

Hello,

Please elaborate the question with more details:
if there was a hook for adding my custom input to Views' "Query Filters" section settings.
How and where do you setup your custom input?
How and where do you want to add that input to Views' "Query Filters" section settings?

There are a document about Views API hooks:
https://toolset.com/documentation/programmer-reference/views-filters/

For example, filter hook "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.
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

For your reference.

#1213830
Image 2019-03-13 at 11.41.33 AM.png
Image 2019-03-13 at 11.32.13 AM.png

Hi. I'm Amin's developer on this project.

We already have the logic in place to affect the output via wpv_filter_query with our custom inputs.

However, this only works when NOT using Ajax search.

And when we use non-Ajax search, our custom inputs end up in $extra (see screenshot), which is fine on its face but Views does something really odd (i.e. I don't understand why but would like an explanation) to such query parameters.
I get sanitizing strings, but all it's doing is essentially converting a 'some-string' value into array( '', 'some-string' )

Please advise if there's a way to add our custom inputs into the Views UI / Settings - in the Query Filters part (see screenshot).