WPML stop encoding slug in class attribute

Question

I have in my WordPress site defined main product attributes, one of these attributes is product color which has 3 colors:
white , yellow , white-and-yellow
my site is translated by WPML plugin to English and Arabic
I need to give special attribute to this category
In English mode it works perfect, but does not work when it turns to Arabic mode, case slug is encoded like this:

variable-item color-variable-item color-variable-item-%d8%a3%d8%a8%d9%8a%d8%b6-%d9%88-%d8%a3%d8%b5%d9%81%d8%b1

instead of:
the main class name should be ‘color-variable-item-أبيض-و-أصفر’

I try to add this code to function.php file

add_filter(‘color-variable-item-أبيض-و-أصفر’, ‘my_class’);
function my_class($classes){
$classes = array();
$classes=array(
‘background-color: red !important;’);
return $classes;
}
How can I stop encoding slug؟

thank

0
Riham N 9 months 0 Answers 81 views 0

Leave an answer