Home › Forums › Bug Reports › value for acf_render_field_setting being overwritten › Reply To: value for acf_render_field_setting being overwritten
Hi John,
When you don’t setup a default, the first option will be selected. That is not the problem.
The problem is, that when i save the field (the field itself works fine), the value is correctly passed through. I’ve tested this on 5.3.5 and it works fine there.
The value attribute should hold the SELECTED option. So, when you save a post and this custom ACF field is on there, the value is saved in the meta and is returned correctly when i fetch it using get_field(‘report_type’). BUT, the selected=”selected” is not add to the option which is selected. This is caused by the bug which is in the first post:
the value is overwritten due to a mis-design. If you program something to check for “isset” and it IS SET, but has no value, it still is set. Therefor it will ALWAYS resort back to the default_value.
If i understand you correctly, you are suggesting that i should use the default_value option to get the correct <option> the selected=”selected” attribute. That would be a big design flaw in my opinion.
If you can debug the acf_render_field_setting function in the ACF PRO plugin and insert an array into the $settings (second attribute) variable, you can see what i mean.
Max
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.