Support

Account

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'
    		));