Home › Forums › ACF PRO › Updating Field Settings in PHP › Reply To: Updating Field Settings in PHP
I was able to remove your duplicate.
I’m actually using my suggestion on a site without any difficulties, for many fields. I needed to give a client the ability to modify field choices without them needing to understand how to make those changes using ACF so I created an options page and when the options page is saved all of the fields with choices are updated. I’m not having an issue with your first item dealing with the ID. I just use the code I included.
However, I am not using local json on this site and I never needed to work through this particular problem. More than likely, your problem with not having the field ID is also due to the existence of the json files because the field ID is not included there and that’s where you were loading the field from. I will file the email from this away for future reference. I kinda agree that calling acf_update_field should trigger the re-saving of the json file, but I’m not the dev either. I have not dug that deep into the update process that ACF uses, more then likely though that happens later in the field group saving process after the fields are all updated.
As far as the undocumented functions go, yes there are a few, but the average ACF user will never need them. I’ve spent many hours digging through ACF code and I’m always glad that it’s well written not not over-complicated. You can almost always find a way to do something, but not always. There are things that just can’t be done and they usually have more to do with what can be done in WP and not specific to ACF.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.