Home › Forums › General Issues › Multiple value of checkbox in meta_query › Reply To: Multiple value of checkbox in meta_query
I don’t see anything wrong with the query based on the information you’ve given for getting posts with one of the values. If you want to do mulitple values at the same time then you have to do
if( isset( $_POST['antivirus_threat'] ) && $_POST['antivirus_threat'] == 'on' )
$antivirus_filter_args['meta_query'] = array(
'relation' = 'OR,
array(
'key' => 'antivirus_featured_threat',
'value' => 'myitems1',
'compare' => 'LIKE'
),array(
'key' => 'antivirus_featured_threat',
'value' => 'myitems2',
'compare' => 'LIKE'
));
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.