Home › Forums › General Issues › Order by true/false field using WP_Query › Reply To: Order by true/false field using WP_Query
I would need to run some tests to give you the correct information, but off the top of my head, I’m not 100% sure about the WP_Query / Null issue.
If you save a post with a checkbox unticked, it will save the value 0.
I agree that the WP_Query should be able to treat no value as a 0 and order the posts correctly.
Perhaps this will require some googleing / debugging your SQL result (from the WP_Query object) to find out why the SQL is not returning the correct results
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We demoed ACF 6.1 Beta during the most recent session of ACF Chat Fridays, highlighting the new ability to regenerate and clear labels, setting the Admin Menu Parent as a slug, and more. Catch the video replay in our latest summary. https://t.co/rHEpPVas64 pic.twitter.com/hB1XKTexXi— Advanced Custom Fields (@wp_acf) March 23, 2023
© 2023 Advanced Custom Fields.