This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Feature request
This topic contains 4 replies, has 2 voices.
Last updated by Nigel 1 year, 11 months ago.
Assisted by: Nigel.
Author | Posts |
---|---|
June 29, 2023 at 9:47 am #13916345 | |
matthewL-3 |
Hi Admin Columns Pro is a widely used plugin to make managing posts / CPTs easy with inline editing within the post list screen. However when editing the status of a post inline with Admin Columns for example this causes the post to go out of sync with the translated version. For example say you set a post to draft it then leaves the translated version still live. Thanks |
June 30, 2023 at 10:33 am #13922873 | |
Nigel WPML Supporter since 02/2016 Timezone: Europe/Madrid (GMT+02:00) |
Hi there That is not specific to Admin Columns Pro. WPML does not offer the option to sync post status across translations (you can see what can be synced at WPML > Settings > Posts and pages synchronization). Some changes to syncing when a post is published (from draft) were introduced in the current version of WPML (4.6.4), whose options are available at WPML > Settings > Translated documents options. The option to offer syncing of post status has been considered, but rejected, though I'm not sure of the reasoning. So you'll need to manually change the status of translated content where relevant, I'm afraid. |
June 30, 2023 at 11:02 am #13923031 | |
matthewL-3 |
This seems really strange not to sync... Anyway if its been rejected I guess we will have to figure out some kind of solution/work around. Just to clarify on what syncs, do Toolset custom fields not sync either? As we have product info in these like external URL, type etc. So its important these sync. |
June 30, 2023 at 11:05 am #13923073 | |
matthewL-3 |
Also just to follow on from this, thinking of using a plugin like WP Webhooks for when a post is updated to trigger an API call to update the translated versions. My understanding is they are just another post but with a different Post ID. How could I find out the linked Post IDs to then pause those Post IDs? Is there an API call I can do to pull these? |
June 30, 2023 at 11:21 am #13923169 | |
Nigel WPML Supporter since 02/2016 Timezone: Europe/Madrid (GMT+02:00) |
For Toolset custom fields you can set their translation preferences (i.e. whether they should be copied or translated) either from within the Toolset settings for the custom fields on the custom field group edit page, or from the WPML settings at WPML > Settings > Custom Fields. If you select Copy, then when you make a change to a custom field value in the default language post and save the post, the updated field value is copied to the translated posts. If you have chosen Translate (because field values should be different on the translated posts) then you would need to update the translation of the translated posts to provide new values. As for programmatically updating the post status, you wouldn't need to use web hooks. You can use WordPress's own API, specifically the save_post hook to add a callback function that takes the ID of the post being saved, gets the IDs of the translated posts (using the WPML API), and updates the post_status of those posts accordingly. To get the IDs of the translated posts you first have to find the translation ID (trid) of the post being saved, using wpml_element_trid, and then find the other posts with the same translation ID (i.e. the translations) using wpml_get_element_translations. See |