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.