Home › Forums › Front-end Issues › Only the last condition outputs as data-condition › Reply To: Only the last condition outputs as data-condition
Your conditional logic array is not set up correctly
$field['conditional_logic'] = array(
// the first nested array holds OR conditions
// there would be a separate nested array for each OR condition
array(
// the second nesting is AND conditions
array(
'field' => 'field_5ed4181bd63dc', // Time field session 1 in the form
'operator' => '==', // If Value is different, then show the field
'value' => $session, // Compare against option page value
),
array(
'field' => 'field_5ed4178dd63d7', // Datepicker fiels in the form
'operator' => '!=', // If Value is different, then show the field
'value' => $date, // Compare against option page value
)
),
array(
// this is an example, if there was an OR condition those would go here
)
);
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.