Home Forums General Issues relation filter with category in wpml Reply To: relation filter with category in wpml

  • Hi Elliot,

    I’m facing the same problem here. If you do not transalte ACF fields some rules are not available for every languages.

    Say you create a group with a rule set to the category “CatA” that exist in english and is translated as “CatA @fr” in french, the group will only appear on english posts set with the english category, not on french posts set with the translated category “CatA @fr”.

    I’ve fixed this for now by adding :

    if( defined('ICL_LANGUAGE_CODE') )
    	$rule['value'] = icl_object_id($rule['value'], 'category');

    in the function ‘rule_match_post_category’ on line 550 of the location.php file.

    I think it would be great for a rule set as “Category” to be applied on posts with translated category. It could also be done for rule set to a specific post or page.