Home › Forums › Backend Issues (wp-admin) › Gallery – serialized data on update_post_meta › Reply To: Gallery – serialized data on update_post_meta
You are getting double serialization when updating. The reason why is that get_post_meta( $post_id )
does not universalize the data the way it would if you wanted to get a specific meta field get_post_meta( $post_id, $key )
.
So you need to maybe_unserialze the value before updating.
add_post_meta( $new_post_id, $meta_key, maybe_unserialize($meta_value));
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.