devgeniem / wp-oopi

OOPI is a WordPress plugin providing an object-oriented library to ease importing data into WordPress from external sources.
GNU General Public License v3.0
8 stars 2 forks source link

Prevent duplicating metadata with Polylang synchronization #1

Open villesiltala opened 4 years ago

villesiltala commented 4 years ago

If Polylang's synchronization for custom fields is enabled, saving translations will duplicate all metadata added for a post. Prevent this by adding a metadata handler for the Polylang integration that filters out all meta keys set for the imported post object. The pll_copy_post_metas filter can be used to implement this.

villesiltala commented 3 years ago

The identification data is already filtered out. Implemented in: https://github.com/devgeniem/wp-oopi/blob/master/src/Localization/Polylang.php#L266