Skip Navigation

[Resolved] Custom search and ACF checkbox results

This support ticket is created 3 years, 5 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: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 3 years, 5 months ago.

Assisted by: Jamal.

Author
Posts
#2147789

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?

#2148741

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.