Support

Account

Home Forums ACF PRO Query posts by checkbox value (dynamically) Reply To: Query posts by checkbox value (dynamically)

  • @john Huebner It most definitely works and I couldn’t find any other way.

    I tried creating a simple Yes/No checkbox. I created a field type “Checkbox” and entered the choices “Yes” and “No”. This doesn’t make a single checkbox like you would think. It makes a “Yes” checkbox and a “No” checkbox. What I wanted was a checkbox where true = “Yes” and false = “No”. Instead, I have to uncheck “Yes” and check “No” to change the saved value. The values display correctly everywhere on my site, but filtering is a problem.

    The values stored in the DB are ‘a:1:{i:0;s:3:”Yes”;}’ and ‘a:1:{i:0;s:2:”No”;}’.

    I’m sure you can see why the compare ‘LIKE’ works with the value ‘Yes’.

    In retrospect, I should have just used a radio button.