Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Support WPML copy syncing for price updates from admin table #43

Open
NateWr opened this issue Jan 30, 2018 · 4 comments
Open

Support WPML copy syncing for price updates from admin table #43

NateWr opened this issue Jan 30, 2018 · 4 comments

Comments

@NateWr
Copy link
Owner

NateWr commented Jan 30, 2018

When editing prices from the admin table, WPML does not sync the changes to post meta. They require a hook be added when the post meta is updated to sync these changes:

do_action( 'wpml_sync_custom_field', $id, 'fdm_item_price' );

This code shhould be added after the post meta update here: https://github.com/NateWr/food-and-drink-menu/blob/master/includes/class-custom-post-types.php#L941

More details can be found in the WPML forums here: https://wpml.org/forums/topic/why-does-wpml-not-listen-to-wp-api-functions-delete_post_meta-add_post_meta/#post-1500291

@strarsis
Copy link

@NateWr: Related solution: #46

@NateWr
Copy link
Owner Author

NateWr commented Jun 20, 2018

Can you describe in more detail how the code you posted in #46 addresses this problem?

@strarsis
Copy link

@NateWr: Yes, the wpml.xml is also used by Polylang and allows to define which fields should be copied over/synced instead independently translated. This is useful for e.g. the price field.

@NateWr
Copy link
Owner Author

NateWr commented Jun 21, 2018

I don't believe the wpml-config.xml file is sufficient to address this issue. This issue is specifically about the price editing feature that appears in the list of menu items. When saved, it updates the post meta (update_post_meta) without doing a full post save, and WPML does not hook into this function, regardless of the wpml-config.xml settings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants