Support

Account

Forum Replies Created

  • @JohnHuebner

    Thanks for this! Works perfectly.

    I understand about the work needed, which was my thought as well.

    After testing this out, perhaps not as much works as anticipated?

    Without actually loading any defaults, meaning to simply trigger the layout to be visible upon page load, if value is NULL this is all that is needed.

    
    add_filter('acf/load_value/name=FLEXIBLE_FIELD_NAME_HERE', 'NAME_OF_YOUR_FUNCTION', 20, 3);
    function NAME_OF_YOUR_FUNCTION($value, $post_id, $field) {
    	
    	if ($value == NULL) {
    		
    		$value = 
    		[0 =>
    		
    			[
    				'acf_fc_layout' => 'FLEXIBLE_LAYOUT_NAME_HERE',
    			],
    			
    		];
    		
    		return $value;
    		
    	}
    	
    }
    

    Any ‘key’ => ‘value’ below ‘acf_fc_layout’ will be relative to the fields in that particular layout.

    Thank you deeply brother for your other information regarding the support flow and yourself 😉 I much appreciate it.

    I think for now then, because this was actually rather simple and lighter than expected, I will leave it not requested as a feature.

    And one the main reasons for me initially going back to check out ACF was the nav menu fields. But of course I’ve chosen to stay and migrate (which I have already done) because there is a lot more. ACF 5 is the version I mention. The JSON option also interests me. I understand JSON from tweaks, etc., but have not worked with it personally. But it is on my list and now I have something to go along in that learning.

  • @JohnHuber

    Ok, thank you. By the way I am a developer and bought ACF a long time ago, at which then I felt it needed more to it. Since the last major update it is complete awesome, so I’ve dove into.

    In that context, I totally understand what you are saying, from an experienced developer point of view.

    It sounds like this would work. I will give it a try then.

    Do you think this could or should be a feature request? I thought it was a more natural expectation that requiring a minimum row layout would automatically load those those requires layout rows for the user to edit, as they are “required”. I didn’t think they would have to actually take an initial step to load what is required in the first place.

    I thought of making this a Feature Request in the spirit of UX. What do you think?

    .. And a again thank you for your detailed response! I appreciate it A LOT!

Viewing 2 posts - 1 through 2 (of 2 total)