Home › Forums › General Issues › Programmatic duplication › Reply To: Programmatic duplication
I’m a little confused about why the field key references the old post if you get all the meta from one post and add them to another.
You should end up with something like.
post_id meta_key meta_value
{old_post} field_name value
{old_post} _field_name field_1234567890123
{new_post} field_name value
{new_post} _field_name field_1234567890123
The field keys should still be the same with a different post_id, unless you’re trying to also put the fields into a duplicated field group with different field keys.
Either that or I’m completely lost about what you’re trying to accomplish. If you’re just trying to duplicate a post have you tried https://wordpress.org/plugins/duplicate-post/. It works well with ACF.
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.