Skip Navigation

[Résolu] Filter two checkbox-values from DB with one select-box as a control?

This support ticket is created Il y a 7 années et 5 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Marqué : 

This topic contains 2 réponses, has 2 voix.

Last updated by Mario Il y a 7 années et 5 mois.

Assisted by: Luo Yang.

Auteur
Publications
#457224
2016-11-15_12h53_22.png
2016-11-15_12h54_45.png

i have two checkboxes as an custom field. One is called "has MTB", the other "has Road". If checked, value 1 is stored in database. Otherwise nothing.

Within a custom search i have to use a dropdown-box/single select-box control with two values (MTB and Road).
If user select MTB i want to filter all posts with a value 1 (checked "has MTB" field) in the database.
If user select Road just all post types with value 1 (checked "has Road" field) should been filtered.

How can i handle this in a smart way? I haven´t found any hints, yet.
Thank you so much.

#457480

Dear Mario,

There isn't such a built-in feature within Views plugin, I suggest you try with Views filter hook "wpv_filter_query" to apply your custom function:
wpv_filter_query
Filters the main Query in a View displaying Posts
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/

#458542

thank you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.