I have a repeater with many different subfields hidden by conditional logic (with different rules for each field). I want to add a true/false that, when on true, show all the fields of the repeater.
So what I could do is add a conditional logic rule to all the fields individually (OR “Show this field îf * true/false* value is equal to checked”) but that adds complexity unnecessarily.
The reason I want to show all the fields with a true/false is because I want all the values to be saved when updating the post (not because I want to see them all at the same time – I would actually hide most fields with a display:none)
– In the conditional logic features, what determines whether wordpress should save the value or not ? Is it the acf-hidden class, the hidden attribute or something else ?
– Could this little hack cause problems somehow? am I better off applying the conditional logic individually?
I used to know how this works but it appears to be far more complicated than just a class now.
fields hidden by ACF have conditional logic
1) The container has a class “acf-hidden”
2) The container has a class “acf-empty”
3) The container has an attribute “hidden”
4) The input field itself has the attribute “disabled”
My guess is that it it #4 that prevents the value from being submitted.
Thank you for your reply. Hmm, what i take from your answer is that it is a bit risky to proceed this way. It’s okay, i can add the conditional rules individually, I just wanted to make it safer/more efficient.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users