I am having trouble to query cpt for the current user if s/he is in the meta value array.
$args = [ 'post_type' => $cp::get_module_cpt(), 'posts_per_page' => - 1, 'meta_query' => [ 'relation' => 'AND', [ 'key' => 'premium_module', 'value' => 0, 'compare' => '=', ], [ 'key' => 'permit_users', 'value' => get_current_user_id(), 'compare' => 'IN', ], ], ];
if has value
Array (  => 29  => 28 ... )
if has no value
return false or empty array. Depends if ever set the field before.
I have tried setting compare to
= equal but that also didn't work. Probably since the value is in array.
The query should return all posts that have current user id in the
permit_usersis an optional, so if the field has not value (false) or empty array, the query should ignore it.