I know I’m bit late for the party but I think this might be useful to someone. The return value change based on the method you use.
If you use get_posts() then it will return null for false values. If you use WP_Query() you’ll get true if checked and false if not checked.
So here is what worked for me. for get_posts()
'meta_query' => array( array( 'key' => 'archived_post', 'value' => '1', 'compare' => 'NOT EXISTS' ),)
'meta_query' => array( array( 'key' => 'archive_article', 'value' => '1', 'compare' => '!=' ),)
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!
© 2022 Advanced Custom Fields.