Home › Forums › Backend Issues (wp-admin) › acf/save_post Generating Duplicates › Reply To: acf/save_post Generating Duplicates
That said, with the exception of the post number jumping by 3, moving the wp_update_post( $my_post ); within each if/else statement; seems to have fixed the initial duplicates issue.
Actually, that makes sense now that you say it.
What was happening was that if the post type was not testimonial, client, or project then you were calling wp_update_post() with an empty array, so WP inserted and empty “post”.
Sometimes it’s easy to overlook the simple things.
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.