Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Asia/Yerevan (GMT+04:00)

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by Nicolas V. 1 day, 6 hours ago.

Assisted by: Christopher Amirian.

Author Posts
April 15, 2026 at 4:22 pm #17972030

stefanoB-10

Hi, we found an issue that cause the wrong escape value saving option pages using acfml (wpml-acf) plugin.
When the field is set to copy or copy-once the script workflow does not consider the unscape needed before save other languages.

In the file acfml/classes/Options/EditorHooks.php this is the fix we need.
Using wp_unslash before the option value save.

Index: acfml/classes/Options/EditorHooks.php
UTF-8
===================================================================
diff --git a/acfml/classes/Options/EditorHooks.php b/acfml/classes/Options/EditorHooks.php
--- a/acfml/classes/Options/EditorHooks.php
+++ b/acfml/classes/Options/EditorHooks.php
@@ -231,9 +231,11 @@
$localOoptionName = $this->optionsPageId . '_' . $languageCode . '_' . $optionName;
$localValue = $this->convertRelationshipField( $value, $field, $languageCode );
+ $localValue = wp_unslash( $localValue );
if ( $overrideExisting ) {
update_option( $localOoptionName, $localValue );
update_option( '_' . $localOoptionName, $optionKey );

April 16, 2026 at 7:20 am #17972957

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support. Thank you for providing the information.

Unfortunately, it is not possible for us to give code suggestions that way, as each small change might have implications for other parts of the code.

We have a code testing system that needs to go through a piping process, and if it is not validated, the code change is rejected.

That is why our development team envolvment on this is necessary, and to do that, we need to replicate an actual issue lacking of the check you mentioned causes, so then I can report this alongside your code suggestion.

May I ask you what the side effects will be and how to replicate the problem so I can report?

I created a clean installation of WordPress and installed and registered WPML Multilingual CMS, WPML String Translation Advanced Custom Fields Pro, and Advanced Custom Fields Multilingual plugins.

You can access the dashboard here:
hidden link

May I ask you to replicate the issue and tell me the steps to check?

Thanks.

April 16, 2026 at 8:45 am #17973361

stefanoB-10

Thank you Christopher
I created the Option Page with a simple textarea and use the get_field in the frontend to write the content in the head. In the screenshots attached you can find the EN page (default locale) that works and the Espanol page that is broken.
The filed is saved only once in the main localization and in others locales is saved wrongly escaped into the DB.

Thank you for the support.

Screenshot 2026-04-16 alle 10.41.08.png
Screenshot 2026-04-16 alle 10.41.45.png
April 16, 2026 at 1:14 pm #17974590

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Thank you for the explanation. I reported the problem to the second-tier support.

I will get back to you if I have news from them.

Thanks.

April 21, 2026 at 12:16 pm #17984110

Nicolas V.
WPML Supporter since 12/2021

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

We released ACFML 2.2.4 today with a permanent fix for your issue.

Thanks again for reporting it and helping us improving our products!