Skip Navigation

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
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Noman 2 months, 3 weeks ago.

Assisted by: Noman.

Author Posts
June 26, 2024 at 8:38 am #15831197

johnS-9

Background of the issue:
I am trying to use an ACF field on an options page, set to 'Copy' mode.

The field is in 'Copy' mode, so I'm expecting the field value to be pulled from the default language. In my theme, I am doing this:

```
$twitter_handle = get_field('twitter_handle', 'option');
```

When viewing the French site, I expect to see `$twitter_handle = 'TwitterHandleHere'`.

Instead, I got `$twitter_handle = null`.

I then go to my options page (which has no editable fields in my other languages).

When viewing the French site, I now see `$twitter_handle = 'TwitterHandleHere'`.

This may be a misunderstanding on my part around how the WPML 'Copy' setting functions. I guess 'Copy' means it is literally copying the value on save to the FR version.

If this is not a bug, could it please be a feature request for 'Copy' (Or a new setting?) to pull the value from the default language directly? Trusting the end user to remember to go and save an options page that doesn't actually have any editable fields on seems rather counterintuitive.

I've added a screenshot of my options page, showing all fields locked and showing the values I'm expecting greyed out.
1 - The currently backend behaviour is confusing. It's not clear from this that the fields in French are technically "empty". It's showing me a greyed out value from the default language in the backend so that's why I'm expecting when I use get_field() to get the default value on the frontend.
2 - I'd prefer not to have to hit save on 1/2/3/4 different languages for every options page.

I've seen some workaround in the community such as this thread, these do work for me but I was expecting ACFML v2 to handle this sort of thing for me: hidden link

Symptoms:
When viewing the French site, I see `$twitter_handle = null` instead of the expected value 'TwitterHandleHere'. After re-saving the options page, the value appears correctly.

Questions:
Can the 'Copy' setting be modified to pull the value from the default language directly? (Or a new setting added).

June 27, 2024 at 1:15 pm #15844266

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for taking the time to submit your feature request. I have escalated your request to our second-tier support team for further review and consideration. I will keep you updated as soon as I receive feedback from their end.

Thank you for your patience and valuable input.