i have this sample code to filter entries using both OR and AND conditions, but it always return all entries. Any suggestions?
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
'mode' => 'all',
array(
'key' => '1',
'value' => '1'
),
array(
'key' => '2',
'value' => '0',
'operator' => '>='
),
array(
'field_filters' => array(
'mode' => 'any',
array(
'key' => '3',
'value' => '8'
),
array(
'key' => '4',
'value' => '6'
)
)
)
)
);
You will want to use GF_Query to do complex conditions. This was asnswered here: Combined ANY/ALL (AND/OR) in GravityForms GFAPI::get_entries?