FAQsWhy are ACF link fields not translated?
Why are ACF link fields not translated?
Link fields show "Copy" but not "Translate" in the Gato Translate config in ACF. Why can't I translate them?
While the plugin can replace an entity ID in the meta with the corresponding entity ID for the target language, it can't do that for ACF link fields.
That's because ACF doesn't store the post ID for those fields, but directly the URL:
a:3:{s:5:"title";s:24:"This is a brand new post";s:3:"url";s:49:"https://mygreatsite.com/this-is-a-brand-new-post/";s:6:"target";s:0:"";}
Without the post ID, the plugin doesn't know how to translate the URL.
A solution is to store use the post object field instead, which does store the post ID, and then do get_permalink($postID)
in your logic.