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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 3 replies, has 0 voices.

Last updated by Bobby 5 months, 2 weeks ago.

Assisted by: Bobby.

Author Posts
October 29, 2025 at 7:23 pm #17530659

sissiB

Background of the issue:
I have an ACF field group with a post object where the return value is set to post object. The translation settings are set to expert, and for the field itself, it is set to 'translate'. I am trying to get the post object for the secondary language even if there is no value set in the main language.

Symptoms:
When I only add a value for that field in the second language, it returns the post ID instead of the post object. However, when I set a value in the main language, both versions return the post object correctly.

Questions:
Why does the ACF post object return a post ID instead of a post object in the secondary language when no value is set in the main language?
How can I ensure the post object is returned correctly in the secondary language without setting a value in the main language?

October 30, 2025 at 11:45 pm #17534519

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

I believe ACF doesn’t know it’s a “post object” field, it just sees a number (the post ID).

That’s why get_field() gives you an ID instead of the full post object.

But if you add a value in the main language, that hidden reference is created and copied across.

Then both languages return a proper post object.

In WPML → Settings → Custom Fields Translation, set the hidden reference meta (the one starting with _) to Copy that matches your ACF field.

This could potentially help ensure that get_field() sees the field type and returns a WP_Post, even if the default language has no value.

Let me know your results, please.

November 6, 2025 at 10:35 am #17553118

sissiB

i did adjust the settings for the field and the hidden meta, but sadly that did not change anything. same behaviour as before.

November 7, 2025 at 5:54 am #17555963

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

The topic ‘[Closed] ACF Post Object return format value not respected in secondary language when no entry in first langu…’ is closed to new replies.