I’m using an acf_form with color inputs to give the front-end user some customisation options to the front-end.
After setting these colors, I save that to a specific CSS file.
I do that after submitting the acf_form.
The acf_form uses hidden input fields where the actual data is stored. The name of such an input field could be acf[field_58d90ee4eabc2].
In PHP I want to retreive the value of that input field, so this is what I do: $new_color_header_bg = $_POST['acf[field_58d90ee4eabc2]'];
But this way the variable $new_color_header_bg stays empty.
Am I missing something here?
Maybe PHP gets confused by the [ and ] in the name, but how to resolve this.
That’s it! Thank you.
After I posted this question I realised that all Post data is available in an array, so I was already thinking about some array ‘sniffing’ to get to the correct values.
But to be honest, I never thought of this one.
You have been very helpfull, as always.
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