Home › Forums › General Issues › Correct Way to Create a New ACF Post › Reply To: Correct Way to Create a New ACF Post
I didn’t find it in the codex. I caught a post on a blog about caching issues when using a third-party cache plugin.
In plain-vanilla WordPress just calling update_field() after wp_insert_post works perfectly. However, we are using WP Super Cache and I’ve seen update_field() fail because the post ID doesn’t exist in the database due to the data being cached in memory.
I don’t have the article on my work computer, I was working on my laptop over the weekend and it’s there.
In any case, WP Super Cache has a filter for database reads and writes and hooking that will flush the memory cache.
Code works fine now.
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.