CustomPress fields & custom loop; how to filter on one checkbox option?

I'd like to create custom loops that filter posts based on checkbox options set up with CustomPress Fields.

I notice that these get stored as serialised arrays, but I don't know how I should unserialise that data for comparing in the query arguments.

The one I've done so far is easy, as it's a single "Yes" checkbox which it either there or not, so the following works:

$args = array(
	'meta_key'   => 'ct_Show_on_Na_checkbox_d9ff',
	'meta_value' => 'a:1:{i:0;s:3:"Yes";}',
	'posts_per_page'  => 20
);

But next I need to create checkbox fields which will have multiple options, for example...

Fruit: [_] Apple [_] Orange [_] Banana

...and be able to query with something like:

$args = array(
	'meta_key'   => 'ct_Fruit_checkbox_d9ff',
	'meta_value' => 'Banana',
	'posts_per_page'  => 20
);

Does anyone know if this is possible and what the PHP would be?

Thanks in advance :slight_smile: