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 Piotr 6 months, 1 week ago.

Assigned support staff: Bigul.

Author Posts
April 7, 2019 at 10:26 pm #3553093

Piotr

Hi,

I need to add a new post via front-end, but the post should have an additional language set (my default language is Polish, and additional is English).
Which hook should be used for that? Is it wpml_set_element_language_details? If so, can I ask for some hints? How to set a new post language?

Peter

April 8, 2019 at 8:53 am #3555741

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Peter,

Welcome to the WPML support forum. I will do my best to help you to resolve these issues.

You can use *wpml_make_post_duplicates* API for this purpose. It will help you to create a Duplicate post in the secondary language while we create posts from the frontend.

Please check the following documentation for more details.

https://wpml.org/wpml-hook/wpml_make_post_duplicates/

To help you faster, I've enabled debug information for this support ticket. Please see this link for how to get this information from your site and give it to us: http://wpml.org/faq/provide-debug-information-faster-support/

--
Thanks!

Bigul

April 8, 2019 at 5:56 pm #3560537

Piotr

Hi Bigul,

thanks for your tip. However, I might have not been too precise – the post must have ONLY one language set, and in my case this should be English, the language configured as an additional in my website. So no Polish translation.

Peter

April 9, 2019 at 9:17 am #3564787

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Peter,

Thank you for the updates. Hope you are trying to achieve the following. Please correct me if I am wrong.

The default language of the site is Polish. When you create a new Post from frontend in Polish, you want to create a related post in English.

But when you create a Post from frontend in English, you don't want to create a related Post in Polish.

Or please share me the exact workflow of the requirement for a better understanding.

--
Thanks!

Bigul

April 9, 2019 at 9:41 am #3564943

Piotr

No, I want to create post ONLY in English (so without Polish translation), which is not my default language (my WPML default language is Polish). And to create the post, I use a form which is available on the Polish front-end. So can I add an English post (without Polish duplicate) from the Polish front-end? Or rather to add an English-only post I need to be on the English front-end?

April 9, 2019 at 1:56 pm #3567645

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Peter,

Thank you for the updates. Which plugin you are using for creating a Post from the frontend.

Please check you can translate the Page and that form to English. Then it will be possible to create the Post from the English page also.

To help you faster, I've enabled debug information for this support ticket. Please see this link for how to get this information from your site and give it to us: http://wpml.org/faq/provide-debug-information-faster-support/

--
Thanks!

Bigul

April 9, 2019 at 4:41 pm #3569411

Piotr

I use Toolset Forms.

So as I understand, the only way to create English post in this case is to create it being on the English version of the website. From there I can have an option to create translation. And vice versa, being on the Polish website I can create Polish-language post and optionally its English translation.

April 10, 2019 at 12:12 pm #3575809

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Peter,

Thank you for the updates. Yes, you have to create an English version of the site and create English Post from the English Page & Toolset form.

Or you can make duplicate Post for English from the Polish Page & Toolset form.

Please check the following documentation for more details and let me know your feedback.

https://toolset.com/documentation/translating-sites-built-with-toolset/translating-content-templates-wordpress-archives-views-cred-forms/

https://toolset.com/forums/topic/duplicate-translation-for-specific-language-with-cred-form/#post-1147220

--
Thanks!

Bigul

April 14, 2019 at 2:54 pm #3608215

Piotr

My issue is resolved now. Thank you!