Problem:
The metafield is not created by Types plugin but a standard worpress metafield, values are separated by comma
When searching by checkboxes, a single checkbox is checked, it return the good result, but more one is checked no results
[wpv-control-postmeta display_values="Famille,Noces/Anniversaire de mariage,Pension,Golf,Spa,Remise" values="Famille,Noces/Anniversaire de mariage,Pension,Golf,Spa,Remise" field="attributs_offres_intranet_wp" type="checkboxes" source="custom" url_param="wpv-attributs_offres_intranet_wp" output="legacy"]
Solution:
The checkboxes field in Views custom search form does not support the custom field you mentioned above:
but a standard worpress metafield
values are separated by comma
In you case, I suggest you try with some custom PHP codes, when user submit the search form, use filter hook "wpv_filter_query" to trigger a PHP function, in this function, get the "wpv-attributs_offres_intranet_wp" value submitted by user:
http://php.net/manual/en/reserved.variables.post.php
Apply them into the Views query one by one:
https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
See the example codes
https://toolset.com/forums/topic/how-to-filter-by-more-than-one-checkbox/#post-631805
Relevant Documentation:
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.
This topic is split from https://toolset.com/forums/topic/search-by-date-metafield-bis/
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 20 replies, has 2 voices.
Last updated by 6 years, 7 months ago.
Assisted by: Luo Yang.