• Resolved keith

    (@wkeithgardner)


    post meta data for a custom post type is corrupted because it first sets null values for keys and then adds the real value for the keys, creating two sets of data with null values and real values.

    i believe this is because it saves the post first, calling the save_post hook, which sets the null values with update_post_meta. then, it imports the meta data using add_post_meta instead of update_post_meta, creating a second set of post meta data.

    fix was to check to make sure a hidden or default $_POST value is set before allowing the save post hook to set post meta data.

The topic ‘post meta corrupted on import’ is closed to new replies.