Hi,
I am using the custom search to filter posts using ACF's checkboxes. The checkboxes indicate the language e.g. ENG, FRA however when I hook it up to the custom search I get fields like a:1:{i:0;s:3:"ENG";} and a:1:{i:0;s:3:"FRA";}. I'm not sure I'm doing this right, is there a better approach here?
Hello and thank you for contacting Toolset support.
Toolset does not store the checkboxes fields in the same way that ACF does. You can't really filter a Toolset view with an ACF checkboxes field. At least without some custom code.
If you want to filter the view, you need to build a new custom field in Toolset and assign the values on it.
If you want to build it using custom code, you will need two pieces of codes:
- The first to generate the filter.
- The second to alter the view's query filter and add a condition on the ACF field, most likely, would be a "LIKE" operator.
Check the following documentation:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
- https://developer.wordpress.org/reference/classes/wp_query/
Please note that custom code is beyond the scope of the support forum. https://toolset.com/toolset-support-policy/
I hope this answers your question. Let me know if you have any questions.