Home › Forums › Bug Reports › True/False Conditional Logic
I have some custom fields setup to display or hide depending on if the true/false field is selected. When I click the T/F box it hides one box and displays another. It works correctly on initial run through, but after publish/update the field that should be hidden. Selected update repeatedly and nothing changed. It’ll operate correctly if I toggle the switch, but displays incorrectly after publish/update.
Here’s the code the ACF if it’d help.
'fields' => array (
array (
'key' => 'field_53b367e82ab5d',
'label' => 'Trip Details',
'name' => 'trip_details',
'prefix' => '',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'min' => 1,
'max' => 1,
'layout' => 'table',
'button_label' => 'This Shouldn\'t Be Here',
'sub_fields' => array (
array (
'key' => 'field_53b3713d3cccc',
'label' => 'Dates',
'name' => 'dates',
'prefix' => '',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'column_width' => 10,
'message' => 'Provided',
'default_value' => 0,
),
array (
'key' => 'field_53b371983cccd',
'label' => 'Season',
'name' => 'season',
'prefix' => '',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
'rule_rule_rule_rule_0' => array (
'field' => 'field_53b3713d3cccc',
'operator' => '!=',
'value' => '1',
),
),
),
'column_width' => 30,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
'readonly' => 0,
'disabled' => 0,
),
array (
'key' => 'field_52256a730fba6',
'label' => 'Depart',
'name' => 'depart',
'prefix' => '',
'type' => 'date_picker',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
'rule_0' => array (
'field' => 'field_53b3713d3cccc',
'operator' => '==',
'value' => '1',
),
),
),
'column_width' => 15,
'display_format' => 'F j, Y',
'return_format' => 'F j, Y',
'first_day' => 0,
),
array (
'key' => 'field_53b36d4f7c811',
'label' => 'Return',
'name' => 'return',
'prefix' => '',
'type' => 'date_picker',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
'rule_0' => array (
'field' => 'field_53b3713d3cccc',
'operator' => '==',
'value' => '1',
),
),
),
'column_width' => 15,
'display_format' => 'F j, Y',
'return_format' => 'F j, Y',
'first_day' => 0,
)
)
)
)
Any chance this could get looked at? Created another project that’s doing the same thing with the latest version of ACF
You must be logged in to reply to this topic.
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!
📣 “ACF Chat Fridays”
— Advanced Custom Fields (@wp_acf) January 31, 2023
The ACF team holds their first open office hours this Friday! Come and talk ACF, and ask questions about building sites with the plugin.
We’d love to see you there!
📆 Friday 3rd Feb - 3pm UTC
👉 Register here - https://t.co/3UtvQbE4CU pic.twitter.com/oTwW9K1XQ0
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.