Home › Forums › Backend Issues (wp-admin) › Saving Default Value to Custom Fields › Reply To: Saving Default Value to Custom Fields
What plugin are you using for the JSON API that you mentioned.
There isn’t any real way to do what you want in ACF unless the API you’re using calls ACF functions. What you need to do is filter the values returned by the JSON API and the best answers for how to do that will come from the documentation and support for that API.
If you want to update all the existing posts to add new fields and remove old fields then that’s going to be a manual process.
You will need to 1) Get all the posts that you want to change. 2) Use delete_post_meta() to delete all the ACF content that you no longer want and 3) Use update_post_meta() to add all the new content.
In steps 2 & 3 don’t forget that you will also need to delete and add the acf field key references.
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.