Background of the issue:
I am trying to use WPML to automatically convert URLs to the translation of a post when it is duplicated. For example, if an English post links to /about-us, the Spanish version should link to /sobre-nosotros. We are also using hidden link to configure custom permalinks for taxonomies and pages. However, WPML is not aware of these custom permalink structures. We have identified that the URL conversion feature happens in the WPML class `AbsoluteLinks`. We can disable the functionality with `wpml_sl_blacklist_requests`, but we can't find an appropriate hook to re-implement the functionality using our custom permalink structures. For pages, we can use the `url_to_postid` filter to return the correct post ID, but we can't return a term from `url_to_postid`.
Symptoms:
WPML is either not translating URLs or resolving to a completely wrong URL due to incompatibility with custom permalink structures. We need a filter within `_process_generic_text` or another part of `AbsoluteLinks` to override the translated URL.
Questions:
Is there a filter within `_process_generic_text` or another part of `AbsoluteLinks` to override the translated URL?
Where can we find an appropriate hook to reimplement the URL replacement feature if we disable the default functionality with `wpml_sl_blacklist_requests`?
No, there is currently no filter that lets you override a translated link inside _process_generic_text(). If you need to change the final link, you’ll have to reproduce the replacement outside this class or patch the plugin.
I am sorry I can't be of better help regarding this problem.