تخطي إلى المحتوى تخطي إلى الشريط الجانبي

الوسوم: 

يحتوي هذا الموضوع 0 ردود ، لديه 0 أصوات.

آخر تحديث بواسطة Angeloca قبل 1 شهر، 1 أسبوع.

يساعده: Shekhar Bhandari.

الكاتب المشاركات
12 مارس، 2026 في 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., الرابط المخفي) — 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., الرابط المخفي), 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.