Open ghost opened 7 years ago
In certain situations syncing posts seems to create duplicate meta fields with same values.
I'll have to do more testing with this but this could be fixes by switching add_post_meta() call to update_post_meta() in save_meta_fields().
Update call will create meta field if it's missing so change will be backwards compatible. More info: https://codex.wordpress.org/Function_Reference/update_post_meta
Possible that the duplicates already exist in the source site/table, for what it's worth.
In certain situations syncing posts seems to create duplicate meta fields with same values.
I'll have to do more testing with this but this could be fixes by switching add_post_meta() call to update_post_meta() in save_meta_fields().
Update call will create meta field if it's missing so change will be backwards compatible. More info: https://codex.wordpress.org/Function_Reference/update_post_meta