WooCommerce Get Post Category with Language Code WPML

Today’s topic is to demonstrate a way to get a WooCommerce Post Category with Language Code while using the WPML module. The example below will get translated category id of the given language. However, keep in mind that this code will work with the already installed WPML module.

Below is an example:

$langCode = 'fr';
$categoryId = 20;

$category = icl_object_id($categoryId,'category',false,$langCode);

Search

Recent Blogs

Categories

Archives

Archives

Tags