Recently I found myself needing to Query a group of Posts (Custom Post Types actually). I had created an ACF Checkbox called Tours, and there were 3 types of Tours: Guided, Unguided, and Pre-booked (The only one where you had to pay/get tickets). So I wanted to create a page with only the Pre-Booked Tours.
Querying CPT using ACF is actually decently easy most of hte time, and ACF has some great documentation on how to do it. However, the ACF Checkbox data is stored as an serialized array, therefore you can not use the IN operator.
<?php
return array(
'post_type' => 'site',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'activities',
'value' => '"pre-booked-tours"',
'compare' => 'LIKE',
),
)
);