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.
Thanks,
Rodolphe
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.