Home › Forums › ACF PRO › Conditional Logic Issue w/ PHP Generated Field Groups › Reply To: Conditional Logic Issue w/ PHP Generated Field Groups
Here’s the php export for two fields where the conditional logic is not working. I have removed several additional options from the choices array on the first field for brevity.
array (
'key' => 'field_538f375f143cb',
'label' => 'Show Related Posts',
'name' => 'tmv_related_posts',
'prefix' => '',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'choices' => array (
'none' => 'Do not show related posts.',
'category' => 'Show posts from Category.',
),
'default_value' => array (
'none' => 'Do not show related posts.',
),
'allow_null' => 0,
'multiple' => 0,
'ui' => 0,
'ajax' => 0,
'placeholder' => '',
'disabled' => 0,
'readonly' => 0,
),
array (
'key' => 'field_538f4d2c3134b',
'label' => 'Related Category',
'name' => 'related_category',
'prefix' => '',
'type' => 'taxonomy',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_538f375f143cb',
'operator' => '==',
'value' => 'category',
),
),
),
'taxonomy' => 'category',
'field_type' => 'select',
'allow_null' => 1,
'load_save_terms' => 0,
'return_format' => 'id',
'multiple' => 0,
),
Happy to provide whatever else you need if that isn’t enough.
JW
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.