Thank you for contacting WPML support, I'd be happy to help you with this issue.
If you want to translate a number field (not only the post ID), and you've registered the custom field for translation please go to WPML > String Translation > Search for the value and translate it.
Or add the code below to the file functions.php in the theme/child theme folder
to translate the number field in the WPML translation editor.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
While checking the debug info, I see that the WordPress Memory Limit is below the requirements. The minimum requirements are 128M, but we do recommend 256M and the debug information of your site shows it set to 64M. Please check this link for more details https://wpml.org/home/minimum-requirements/.
You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:
Thanks for that complete answer!
I found that piece of code before your answer on this support ticket 🙂
I tried it already and indeed the field now appears in the translation editor.
However, is it possible to make WPML translate the content of a post meta containing the ID of a custom post type to the ID of that translated post automatically by using something like this in wpml_config.xml (like for shortcodes) :
Yes, you are correct. I'm afraid that there isn't a way to auto adjust ID in the field value. The type "post-ids" is used for the Gutenberg block configuration code.
For the field value, if you translate the ID number in the translation editor, no need to use the filter hook "wpml_object_id". If you don't translate the ID number, you can use the filter hook to get the translation post ID in the current language.
Or you can consider saving the post permalink as the field value, then WPML can adjust the internal link automatically.