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.

This topic contains 1 reply, has 2 voices.

Last updated by Dražen 3 years, 3 months ago.

Assisted by: Dražen.

Author Posts
March 21, 2022 at 9:08 am #10835079

jussiJ

My plan is to insert/update/remove categories using WP REST API. Native language is for example english and translation spanish. Inserting category to WP is pretty easy because WP REST API has built-in feature for that. I also have translation for the category in data that I insert to WP by using REST API. I like to update translation right after category has been inserted to WP. How I should do that with WPML? It should happen by using php so I assume I need several hooks to handle translation. But is this even possible?

March 22, 2022 at 12:56 pm #10847087

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello!

Welcome to WPML Support. I'll do my best to help you solve this issue.

I do think this is currently possible via WP Rest API and WPML. This was implemented only for WooCommerce: https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/#creating-taxonomy-terms-product-category-tag-attribute-shipping-class.

WPML is compatible with WP All Import, maybe you can use that approach:

- https://wpml.org/documentation/related-projects/wpml-all-import-plugin-website-import-with-wpml/#importing-posts-with-taxonomies

Other than that, probably could be achievable via some extensive custom code. You may find useful info on the next link:

- https://wpml.org/wpml-hook/wpml_set_element_language_details/
- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

For custom coding work, you can contact one of our certified partners who can develop small to large features for your site: http://wpml.org/documentation/support/wpml-contractors/

I hope I was helpful. Don't hesitate to ask if you find any problem along the way, I'll gladly help you.

Regards,
Drazen