Closed jccbbb closed 3 months ago
Hi @jccbbb
Did this field ever have conditional logic enabled? It looks like it's currently set up with partial conditional logic rules. If you change the code to the following it should work as expected:
acf_add_local_field_group( array(
'key' => 'group_65e5dd4b82fd6',
'title' => 'Disable footer on current page',
'fields' => array(
array(
'key' => 'field_65e5dd61f0f44',
'label' => 'Do you want to disable the footer on this page?',
'name' => 'disable_footer_on_this_page',
'aria-label' => '',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'wpml_cf_preferences' => 1,
'message' => '',
'default_value' => 0,
'ui' => 0,
'ui_on_text' => '',
'ui_off_text' => '',
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
),
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'page',
),
),
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'produkt',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'seamless',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
'show_in_rest' => 0,
'acfml_field_group_mode' => 'translation',
) );
} );
The only change there is switching conditional_logic
from that array to 0
, which is what ACF should export automatically if conditional logic has been disabled prior to export.
Hello @mattgrshaw,
Thank you for helping me! This has made me crazy a dozen of times haha 😄 Just one idea/question.
Wouldn't it be better than if you set it as active but then doesn't set any value in "Show this field if" at all that it would highlight an error on save? Or is there any use cases where someone would like to set "Conditional Logic to "True" but no value at all in "Show this field if"?
@mattgrshaw can you please get back to this with a reply of my last message? 😊
Describe the bug When using the True/False field in a field group and then checking it on a page for example does it immediately fold together and then it isn't possible to fold it out anymore to change/update the value.
To Reproduce Steps to reproduce the behavior:
Expected behavior It shouldn't fold together and the checkbox should be checked and possible to uncheck it afterwards as well.
Screenshots or Video![acf field bug](https://github.com/AdvancedCustomFields/acf/assets/25697666/2ae43b70-d43b-4429-a96e-9b92057d537c)
Code `add_action( 'acf/include_fields', function() { if ( ! function_exists( 'acf_add_local_field_group' ) ) { return; }
) ); } ); `
Version Information: