Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle layout removes layout from ACF front-end form #130

Open
Dennisscholten opened this issue Aug 13, 2024 · 1 comment
Open

Toggle layout removes layout from ACF front-end form #130

Dennisscholten opened this issue Aug 13, 2024 · 1 comment

Comments

@Dennisscholten
Copy link

After toggling a flexible layout and saving the page, the layout itself disappears from acf_forms that are displayed on the front-end.
In the back-end the layout is there and works as expected.

Disabling the 'load_value' function in field-flexible-content-actions.php makes the field appear in the front-end form (but also in the content, of course). My guess is that the filter for unsetting layouts works through on front-end displayed acf_forms. Is there a fix for this?

@acf-extended
Copy link
Owner

Hello,

Thanks for the feedback!

Yes, this is the side effect of how ACF load values on the front-end. ACF use same method when using get_field() or when rendering actual fields input (<input type="text" ... />) within an acf_form().

Unfortunately, at the moment, there is no way to make the difference between them. Additionally, ACF cache the value the first time it is retrieved, which will present the same output if you display the Flexible Content with have_rows() on the same page as the acf_form() itself.

I'll have to implement some workaround here in order to make it behave correctly. I'm adding it on my todo list see what can be done.

Thanks!

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants