Hello,
Thanks for the details, and sorry for the late answer, I was kinda busy with the latest patch lately.
I managed to reproduce the case. The addon you are referring to is ACFML. With that addon, and the “Copy Translation” setting enabled in the Relationship Field setting, it will copy the data to the translated post with the translated Post ID.
I took a look at the code of the addon, and there is a problem which prevent any third party plugin such as ACF Extended to apply new features.
In fact, ACFML update the post meta on the translated post using the native wp update_post_meta()
function, which means ACF (and other ACF-related plugins) aren’t aware of that update.
In file \acfml\classes\class-wpml-acf-worker.php:45
update_post_meta( $post_id_to, $meta_key, $meta_value_converted, $meta_value );
In order to follow the ACF coding best practice, ACML should use acf_update_value()
to update the post meta. So their process trigger the native ACF update logic, and subsequent hooks such as acf/update_value
, which is then used by third party plugins like ACF Extended.
Like this:
acf_update_value( $meta_value_converted, $post_id_to, $field );
Unfortunately I can’t really do much here, since update_post_meta()
is such a wide-range function outside of ACF scope. Also, there is no hook available in that part of their code which would let me workaround the issue and add some compatibility fix.
I would recommend to contact the WPML support to report them that enhancement. This will be for the best for ACFML, as it will make the addon more ACF-friendly globally.
Here is a video showing the fix applied.
As a side note, outside of ACF Extended, there are also some other issues in the ACFML code logic that I noticed. For example, the ACFML “copy” feature for the Relationship Field doesn’t work if the Relationship is a sub field of a Group Field.
This is because they do a simple check on the meta key acf_get_field( $meta_key )
, while the meta key can be composed with the parent Group Field. But this is an another issue.
Here is a video showing the issue with ACF + WPML + ACFML only (ACF Extended is disabled).
I hope it’s now more clear.
Have a nice day!
Regards.