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.
Tagged: Exception
This topic contains 29 replies, has 2 voices.
Last updated by Andrey 1 year, 1 month ago.
Assisted by: Andrey.
Author | Posts |
---|---|
October 12, 2023 at 11:53 am #14565723 | |
johnS-9 |
Every time I select my new post type (Collections) to be translatable – it allows me to translate my post once. However if I go back and edit and publish the English version, it immediately reverts back and it's no longer translatable |
October 12, 2023 at 1:32 pm #14566463 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
It seems like the Collections CTP has been predefined somewhere in the configuration file. Do you know where it comes from? One way to redefine it is through the Custom XML Configuration tab as shown in this article https://wpml.org/documentation/support/language-configuration-files/#custom-types. First, you need to go to WPML → Settings, then to the Custom XML Configuration tab and add the following code: <wpml-config> <custom-types> <custom-type translate="1">collection</custom-type> </custom-types> </wpml-config> I hope this helps. |
October 12, 2023 at 5:47 pm #14567955 | |
johnS-9 |
Hi Andrey, thanks for your reply. Which config file are you referring to sorry? I have just tried adding the custom script example you had sent to the XML config, and the language bar now appears, however the dropdown is empty and won't let me select anything. Please see screenshot attached. Would you have any idea how to resolve this? Thanks! |
October 12, 2023 at 7:32 pm #14568763 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
I assume that if Collections come from a theme or plugin, their configuration is predefined in the config. Each plugin or theme may have its own wpml-config.xml file in the folder. Or did you create Collections yourself? |
October 12, 2023 at 7:42 pm #14568801 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
It's highly recommended that you update any outdated plugins on your website, including WordPress. This will ensure that your site is functioning correctly and will help to keep it secure against any potential vulnerabilities. |
October 13, 2023 at 8:51 am #14571203 | |
johnS-9 |
Hi Andrey, my collections post type was created manually and not by another plugin. I am using the up to date WPML plugin with WordPress 6.2. No other post types that are being translated don't seem to have this issue, it is only the 'Collections' post type. Thanks |
October 13, 2023 at 9:16 am #14571485 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Could you show me how you created it? Also, please create a test CPT and let me know the results. |
October 13, 2023 at 10:06 am #14571819 | |
johnS-9 |
I have registered my custom post type within my functions using WordPress' standard register_post_type function e.g. https://developer.wordpress.org/reference/functions/register_post_type/ Do you mean to create another brand new custom post type or did you mean to create a test 'collection' post? Thanks |
October 13, 2023 at 12:56 pm #14573221 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Yes, create a new test custom post type and check the results. Maybe it was some mistake in the code when you were registering 'collection'. Try to use this Post Type Generator: |
October 13, 2023 at 3:53 pm #14574529 | |
johnS-9 |
Hi Andrey, I can confirm it is set up like the example link you had sent. I have added a new example CPT but that has the same issue and doesn't save the translation post type settings. I have multiple other post types that are set up in the same way but they are translatable and do not have this issue. It is any new ones that I add in. |
October 16, 2023 at 7:16 pm #14588325 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
Thank you for your tests. There seems definitely something wrong. I need to 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. 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, meaning only you and I can see and access it. Before providing access, please test if a third-party plugin doesn't affect this behavior. If you can make a quick test with all plugins disabled except WPML, it would help. |
October 18, 2023 at 11:34 am #14603541 | |
johnS-9 |
Hi Andrey, I have just deactivated all plugins and noticed what is causing the issue. It seems to be coming from the WPML String Translation. When I deactivate this, the posts remain translatable and work as normal. However when activating this again, it stops working. Would you know what is causing this conflict? Thanks |
October 18, 2023 at 11:55 am #14603759 | |
johnS-9 |
I can also confirm that WordPress and all my plugins are up to date |
October 18, 2023 at 12:18 pm #14603977 | |
Andrey Supporter Languages: English (English ) Russian (Русский ) Timezone: Europe/Kyiv (GMT+02:00) |
It seems to be coming from the WPML String Translation. |
October 18, 2023 at 12:25 pm #14604079 | |
johnS-9 |
Sorry I'm not sure what slugs you would suggest to delete? Can you help me with regards to what exactly would be the conflict with this? Thanks |