Filter term_link not handled correctly by WCML
-
After updating everything to the newest version something goes wrong with translation product attribute term permalinks:
When retrieving get_term_link($term), the attribute-name slug is removed from the returned string. For example, when calling:
get_the_term($term);
I get https://myshop.com/product-attributes/term-name/ returned instead of https://myshop.com/product-attributes/attribute-name/term-name/.
The link is returned correctly when removing the following filter before calling get_term_link():
global $woocommerce_wpml; remove_filter('term_link', array($woocommerce_wpml->terms, 'translate_category_base'), 0); get_the_term($term);
So the issue seems to lie there. Of course, when removing this filter, the url isn’t translated correctly anymore, so it’s not a fix, but I hope it helps you find the problem.
- The topic ‘Filter term_link not handled correctly by WCML’ is closed to new replies.