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.

This topic contains 28 replies, has 4 voices.

Last updated by Andreas W. 1 month, 3 weeks ago.

Assigned support staff: Andreas W..

Author Posts
May 22, 2020 at 6:37 pm #6197735

babakF-3

I call get_field_object("field_name") to get an ACF field in the current language. The field is defined for all (two) languages on my site. It's a select with the same values, but with labels in the two languages.

In the past, calling this function would give me the object in the current language, meaning I could use it to return the label in the current language, for the selected value.

Today, I was alerted to the fact this no longer works. Calling get_field_object("field_name") returns the field object in the default language (English). Even when the current language is the secondary language (Dutch).

How to resolve this?

May 23, 2020 at 7:38 am #6200085

Izzi Hassan
Supporter

Languages: English (English )

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

Hi,

Thank you for reaching out to WPML Support and providing your Debugging Information.

Please make sure to take a full backup of your website before trying the steps below.

As a first step, please update your theme and plugins to the latest versions as described here:
https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/

I can see that you're using an older version of WPML which would explain the new compatibility issues as we update to keep up with changes in WordPress and ACF.

We will be happy to assist you further once you update and test.

Stay safe!

May 23, 2020 at 12:12 pm #6200925

babakF-3

Thanks for noticing. I updated the plugins to their latest version, but the problem persists.

May 25, 2020 at 6:59 am #6207343

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Thank you for contacting WPML Support.

Could you please add me your code where I can see how you call it and also show me the output you get? Thank You

Best Regards
Marcel

May 25, 2020 at 11:32 am #6209581

babakF-3

To get the ACF field object:

print_r(get_field_object("type"));

Output (in both languages):

Array ( [ID] => 86 [key] => field_5a35844e03077 [label] => Type [name] => type [prefix] => acf [type] => select [value] => Array ( [0] => educationprogram ) [menu_order] => 2 [instructions] => [required] => 1 [id] => [class] => [conditional_logic] => 0 [parent] => 85 [wrapper] => Array ( [width] => [class] => [id] => ) [wpml_cf_preferences] => 1 [choices] => Array ( [other] => Other [booklaunch] => Book Launch [congress] => Congress [debate] => Debate [discursive] => Discursive [educationprogram] => Education Program [exhibition] => Exhibition [exhibitionary] => Exhibitionary [learning] => Learning [lecture] => Lecture [lecture-performance] => Lecture-Performance [lectureprogram] => Lecture Program [paneldiscussion] => Panel Discussion [performance] => Performance [performative] => Performative [performativeconference] => Performative Conference [presentation] => Presentation [publiceditorialmeeting] => Public Editorial Meeting [publication] => Publication [readinggroup] => Reading Group [screening] => Screening [seminar] => Seminar [symposium] => Symposium [talk] => Conversation ) [default_value] => Array ( [0] => other ) [allow_null] => 0 [multiple] => 1 [ui] => 0 [return_format] => value [ajax] => 0 [placeholder] => [_name] => type [_valid] => 1 )

May 26, 2020 at 7:50 am #6216137

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Thanks for the info. Please update all WPML Add-Ons to the latest version and try it again (From Core 4.3.6 to 4.3.14).

Please let me know.

Best Regards
Marcel

May 26, 2020 at 10:57 am #6218265

babakF-3

They already were. You can see in this thread they I updated all plugins to their latest version.

May 26, 2020 at 2:43 pm #6220981

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Oh thanks, I missed that part. May you have a staging site where I can take a look?
For this, I would need request temporary access (WP-Admin and FTP) to your site
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed

Your next answer will be private which means only you and I have access to it.

❌ Please backup your database and website ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank you

Best Regards
Marcel

May 26, 2020 at 5:32 pm #6222541

babakF-3

This is a bit problematic, as there is no staging environment.

Is there a way to try and troubleshoot this without adjusting the configurations of the site?

May 27, 2020 at 7:11 am #6226395

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

if you want we can migrate the site to our Cloudways server over a plugin, then I will not troubleshoot on your live environment. Do you agree? Then I will setup the server.

Please let me know

Best Regards
Marcel

May 28, 2020 at 12:17 pm #6238979

babakF-3

Yes, that would be a workable solution.

I'm also curious to know what plugin you will use for this.

May 29, 2020 at 11:56 am #6249449

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hello,

My colleague Marcel is not available today, which for I would like to take care of this issue.

Our Cloudways Server is sadly in maintainance at the moment, but I can offer to take a copy of the site with Duplcator or WP All In One Migration.

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT

Please make a backup of site files and database before providing us access.
If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Kind regards
Andreas

May 31, 2020 at 6:13 pm #6261341

babakF-3

Before I provide you the details, can you tell me what you mean with 'locally'? Locally on the server hosting this website, or locally on your end somewhere?

June 3, 2020 at 6:26 am #6279821

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hello,

With locally I mean, on Localhost with a virtual server that is running on my local machine.

As alternative I can offer to create a App on our Cloudways server and you can migrate a copy of your website there.

Let me know what would be more convenient for you.

Kind regards
Andreas

June 7, 2020 at 4:06 pm #6315295

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hello,

I do have problem to find the field of your example.

Could you please provideme a detailed description about which field group and which field is causing problems?

You would like to have the labels translated, correct? In this case you would need to translate the Field Groups.

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#translating-field-groups

Kind regards
Andreas