Giter VIP home page Giter VIP logo

Comments (3)

mattgrshaw avatar mattgrshaw commented on August 16, 2024

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.

from acf.

jccbbb avatar jccbbb commented on August 16, 2024

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"?

image

from acf.

jccbbb avatar jccbbb commented on August 16, 2024

@mattgrshaw can you please get back to this with a reply of my last message? šŸ˜Š

from acf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.