Zum Inhalt springen Zur Seitenleiste springen

Schlagwörter: 

Dieses Thema enthält 0, hat 0 Stimmen.

Zuletzt aktualisiert von Angeloca Vor 1 Monat, 1 Woche.

Assistiert von: Shekhar Bhandari.

Autor Beiträge
März 12, 2026 um 7:39 #17890954

Angeloca

Hello,
I'm running a WordPress Multisite with WPML and ACFML. I have an ACF field group ("Dettagli pagina", key: group_5a045b398c16f) that includes two button groups used in page headers. Each button group has a text sub-field and a url sub-field (both ACF Text fields).

Setup:
• WordPress Multisite (subdomain install)
• WPML + ACFML (latest versions)
• ACF PRO (latest version)
• Field group mode: acfml_field_group_mode: "advanced"
• The button groups (button_1, button_2) and their sub-fields (text, url) are all set to wpml_cf_preferences: 2 (Translate)

The problem:
When I use WPML's automatic translation, the text sub-fields are correctly translated, but the url sub-fields — which contain internal site URLs (e.g., versteckter Link) — are sent to the translation engine as plain text. The translation engine doesn't know these are internal links and either leaves them unchanged (pointing to the default language page) or occasionally garbles them.

What I expected:
I expected WPML/ACFML to detect that the URL is an internal link and automatically adjust it to point to the translated version of the target page (e.g., versteckter Link), similar to how WPML adjusts internal links in post content.

What I've tried:
1. Setting the fields to "Translate" (wpml_cf_preferences: 2) — URLs are sent to the translation engine, which doesn't handle them properly.
2. Setting the fields to "Copy" (wpml_cf_preferences: 1) — URLs are copied as-is, no conversion happens.
3. Using translate_link_target="1" in wpml-config.xml — Based on forum responses, this attribute doesn't work with ACF fields.
4. Changing the field type to page_link — This would work because it stores post IDs (which WPML can convert), but it would prevent users from entering external URLs or anchor links (e.g., #section), which is a requirement for our use case.

My question:
Is there a way to have WPML/ACFML automatically convert internal URLs stored in ACF Text (or URL) fields to their translated equivalents during automatic translation? If not, is this a planned feature?

Currently, the only workaround I can think of is writing a custom PHP filter that converts internal URLs on the frontend using url_to_postid() + wpml_object_id. But this feels like something WPML should handle natively, especially since it already does this for links in post content (Gutenberg blocks, WYSIWYG fields).

Thank you for your help.