Skip to content Skip to sidebar

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.

This topic contains 3 replies, has 2 voices.

Last updated by Marcos Vinicios Barreto 3 years, 5 months ago.

Assisted by: Marcos Vinicios Barreto.

Author Posts
March 18, 2022 at 2:12 pm #10823211

ahmadA-64

I'm using the following hook to duplicate products and blog posts:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-606461
but I only can duplicate products and blog posts, I need to also be able to duplicate product categories, taxonomy, tags, etc. (other post types)..

How can I achieve that using code/hook.

Thanks.

March 22, 2022 at 1:08 am #10841979

Marcos Vinicios Barreto

Hello,

Thank you for contacting our support service. Before being able to give you a more detailed and accurate answer, I would appreciate some more details:

1 - Do you need to duplicate the content to the secondary languages or primary language?

2 - The hook at https://wpml.org/wpml-hook/wpml_admin_make_post_duplicates/ is meant to create a post duplication in the secondary language, so, it means all the attached categories, tags and so on will also be created in the secondary languages, see: https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#duplicating-content

3 - Do you need some way to programatically create the taxonomy terms in the secondary languages? If so, we don't have means for that out of the post creation, you can experiment to set these terms to fallback to the default language, it means if they don't have a translation the default language term will be used instead, for that, you can refer to this guide: https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/

4 - You can also try to duplicate posts in a bulk if it helps to attend your needs, for that, you can refer to this guide: https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/#how-to-duplicate-pages-and-posts-in-bulk

Please, let me know if it helps, have a nice day.

March 25, 2022 at 7:15 pm #10879885

ahmadA-64

Hi,
thank you for your reply.

I need to be able to allow auto duplicates for product categories when I add one inside the category page.
The duplicated category should be in the translation language. (my main language is English, and my translation language is Arabic.) So When I add a category in English (say Toys) I need a code to automaticly create a duplicate for (Toys) in the Arabic language.

The duplicate can be exactly the same, and I can then enter and edit that duplicate to be the translation of the category (Toys)

This is what I'm doing with the products and blog posts using the hook at https://wpml.org/wpml-hook/wpml_admin_make_post_duplicates/

I need the same for product category, tags, and other post typs.

I hope this is clear.

Thanks

March 28, 2022 at 7:32 pm #10896793

Marcos Vinicios Barreto

Hello,

Thank you for the updates. Unfortunately it would involve custom code which is out the scope of our support policies (see https://wpml.org/purchase/support-policy/). For this kind of task, we recommend you to refer to one of the WPML contractors at https://wpml.org/contractors/ which are able to proceed with custom solutions based on WPML.

Thank you for your understanding, have a nice day.