Open
Description
set_meta()
never actually deletes any post meta. This appears to always have been an issue but was exacerbated by a bug we introduced in 1.3.4 that was duplicating empty meta values that are now kind of stuck in place because of the way update_post_meta()
works with previous values.
I don't yet know what the right thing to do is. We could:
- Be less performant and just wipe out everything not blacklisted before adding again
- Try to do some trickery with slicing the existing meta arrays down and matching up against the length of the new data and deleting the ones that are no longer represented. The issue with this is that for these situations where we have duplicated values (I don't know if there's ever a time where that's a valid thing people want to do??) it will wipe out all of the post meta with that same value regardless of how many items there are supposed to be. They will get added back, presumably, but that still seems like a weird routine.
- Something else I haven't managed to think of yet
I guess the biggest question to start is: what kind of situations would there be where the distributed post has meta that the origin post did not have and need to keep?
Metadata
Metadata
Assignees
Type
Projects
Status
In Progress