Skip Navigation

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: 

This topic contains 8 replies, has 2 voices.

Last updated by raviS-7 1 year, 4 months ago.

Assisted by: Long Nguyen.

Author Posts
October 5, 2023 at 2:01 am #14516135

raviS-7

Tell us what you are trying to do?

Below are the steps we follow. Please note English is our default language.

- Create the Event in English
- Save the event as DRAFT in English
- Go to bulk translate and translate this particular event in French, Russian, Spanish using auto translation
- Review the translations
- Go to Event in English
- Publish the event

Expected output
- Event must be published in all 4 languages

Current Output
- Event is publishing only in English

I have already checked the Translated Documents Options and that is set to "Same as Original Content"

October 5, 2023 at 3:20 am #14516177

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Ravi,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

Firstly, please update WPML plugin on your site to the new version 4.6.6. Refer documentation https://wpml.org/faq/install-wpml/#checking-for-updates

If you want to publish the translation posts when the original post is published, please go to WPML > Settings > Translated documents options > Enable options:
- When you publish the original post: Publish the post translations.

If you want to test this on a clean installation of WordPress, here is the sandbox site URL hidden link

Look forward to your reply.
Thanks

October 5, 2023 at 4:19 am #14516235

raviS-7

Hi Long,

Please see the attached image. I don't see any option to enable.

Screenshot from 2023-10-05 09-49-09.png
October 5, 2023 at 4:30 am #14516285

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Have you updated WPML plugin to the new version as I mentioned above?

October 5, 2023 at 4:34 am #14516289

raviS-7

Hi

Updating the new version will take time for us. And I have checked change log from my current version to all latest versions and I don't see any change related to this.

October 5, 2023 at 4:43 am #14516293

raviS-7

Hi

The issue will be I will need to update the Core WordPress and all other plugins not just WPML. And our site is on production which will need re-testing whole site. Is there any other way I can fix this?

October 5, 2023 at 4:52 am #14516299

raviS-7

Hi

Also what about the other configurations will it stay as it is?

October 5, 2023 at 6:43 am #14516909

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

And I have checked change log from my current version to all latest versions and I don't see any change related to this.

It is noted in the changelog, from WPML version 4.6.4 https://wpml.org/download/wpml-multilingual-cms/?section=changelog

"Added a new setting to publish translations when the post status is changed."

Also what about the other configurations will it stay as it is?

Yes. You can also create a backup for your site and database before proceeding.

Is there any other way I can fix this?

In the previous version, the option "Same as Original Content" will help you to sync the post status at once. You can see the Draft status is applied to the translation post. But if you change the original post status to Publish, it will not be synced. If you don't want to update WPML to the new version, please edit each post in a second language and publish them manually.

Regards.

October 5, 2023 at 8:29 am #14518233

raviS-7

Here is my solution.

Same as what you are doing just we don't want to choose and we want to apply this all the times

add_action('transition_post_status', 'on_post_status_change', 10, 3);

function on_post_status_change($newStatus, $oldStatus, $post)
{
if ($newStatus === $oldStatus) {
return;
}

$post_types = ['page', 'post'];

if (in_array($post->post_type, $post_types)) {

$allPosts = \WPML\Element\API\PostTranslations::get($post->ID);
if (empty($allPosts)) {
return;
}

foreach ($allPosts as $sourceLangCode => $data) {
if ($data->post_status != $newStatus) {
wp_update_post(['ID' => $data->element_id, 'post_status' => $newStatus], 0, 0);
}
}
}
}

October 5, 2023 at 8:31 am #14518255

raviS-7

See last comment.