ACF checkbox meta query

The below isn’t working, can’t see why. is_focus_product is a True/False

$ls = get_posts([
‘meta_query’ => [
[
‘key’ => ‘is_focus_product’, ‘value’ => 1, ‘compare’ => ‘=’
]
]
]);
// array(0){}

However this returns as expected…

var_dump(get_field(‘is_focus_product’, 36));
// bool(true)

Read more here:: ACF checkbox meta query

Leave a Reply

Your email address will not be published. Required fields are marked *