Home › Forums › General Issues › Headless WordPress: ACF fields return empty once a post is created with WP-API › Reply To: Headless WordPress: ACF fields return empty once a post is created with WP-API
Thanks for the reply John. Through digging deeper, I’ve discovered that when creating a post that has ACF fields via the wp-api, for whatever reason none of those ACF fields are saved to the wp_postmeta table yet. It’s the “hard save” in the wp-admin panel that actually saves the ACF fields and stores them in the wp_postmeta table.
I’ve tried to find a way to mimic that but have had no luck. If only there was a way to create a post that has ACF fields with the API, and then have those fields write to the wp_postmeta table upon creation. They just don’t save to the db until the “update” button is clicked 🙃
Which is incredibly unfortunate when trying to use WordPress only as a Headless CMS, with no wp-admin interaction except via the API.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.