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: Custom Work
Author | Posts |
---|---|
March 31, 2025 at 5:39 pm #16880459 | |
justinV-10 |
Background of the issue: Symptoms: Questions: Which hook can be used to trigger automatic translation that WPML listens to? This is a pure code and developer question. It is at least to my knowledge nothing about the configuration as adding new posts manually works flawless. |
March 31, 2025 at 6:05 pm #16880570 | |
Bigul Supporter
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Please share the code you are using for creating the posts, so it will be very helpful for us to cross-check. -- Bigul |
April 1, 2025 at 8:31 am #16881814 | |
justinV-10 |
The code used is the following: // Update or insert vehicle post $post_id is either "0" or one existing id. |
April 1, 2025 at 3:01 pm #16883634 | |
Bigul Supporter
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Thank you for the updates. In which function/action are you calling the following code? $post_id = wp_insert_post([ 'ID' => $post_id, 'post_type' => 'vehicles', 'post_title' => $title, 'post_status' => 'publish', 'post_name' => strtolower(sanitize_title($title)) . '-' . $vehicle->getId() ], true); Maybe the automatic translation is not working as expected for these CPTs becuase the above code will not be triggering the save_post hook. Please check and let us know your feedback. -- Bigul |
April 1, 2025 at 3:05 pm #16883682 | |
justinV-10 |
wp_insert_post does call save_post: hidden link This is likely not the issue. Could you please check with your developers as they should know the answer to this 🙂 |
April 1, 2025 at 5:26 pm #16884199 | |
Bigul Supporter
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Thank you for the updates. I consulted about this with our developers, and this requires further checking. So one request. It would be great if you reproduce the issue in our sandbox site, a fresh installation - hidden link Please configure WPML like your live site. Then, create a CPT and insert a few posts to CPT using your code. It will help us a lot in debugging, and we can escalate the ticket directly to our developers. Thank you for your kind understanding. -- Bigul |
April 1, 2025 at 5:54 pm #16884245 | |
justinV-10 |
I can´t i need auto translate and for that i need to pay. Without sounding rude, i am not willing to pay extra to help you debug this. |
April 2, 2025 at 11:21 am #16886589 | |
Bigul Supporter
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Thank you for the feedback. Sorry, I forgot to mention about Automatic Translation. You don't have to configure it. It is a pure sandbox site. I have added some dummy data to enable the sandbox automatic translation. Please create a Custom Post Type and insert a few posts to CPT using your code. Then, make sure the bug exists or not. -- Bigul |
April 3, 2025 at 7:32 pm #16894686 | |
justinV-10 |
Hi, Sadly the sandbox seems to not be compatible with our plugin which is why it crashed after installing. We were able to validate that the issue is not with programmatic updates but also with manual ones. There is one translation job that is stuck and i can see a lot of Error in the "Advanced Translation Editor Error Logs". All for the same job and this error: https://wpml.org/de/faq/the-uploaded-xliff-file-doesnt-belong-to-this-system/ To me it seems like bug but with a different nature than i initially thought. I can provide login credentials and you can try it out yourself. Just log in and update any vehicle that does not have an english translation yet. You will see the automatic translation is not creating it. |
April 4, 2025 at 1:32 pm #16897772 | |
Bigul Supporter
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, Thank you for the updates. A couple of requests to track this bug. 1) Please let us know the exact steps to create the Vichles posts automatically 2) Please fill the private details fields after a full site backup. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our privacy information sharing policies. hidden link -- Bigul |
April 4, 2025 at 2:58 pm #16898184 | |
Bigul Supporter
Languages: English (English ) Timezone: Europe/Vienna (GMT+02:00) |
Hello, We have discussed this with our development team, and it appears that the solution would require custom coding, which falls outside the scope of our support. Currently, there is no built-in feature to support this functionality, especially since the requirement involves two separate WordPress installations. One possible approach could be using custom redirects from /en to /stay or implementing a custom language switcher. Another option could be avoiding the use of /en entirely and consistently redirecting to /stay, but in that case, care must be taken to ensure nothing gets indexed or added to the sitemap. That said, it might be achievable with the help of a WordPress Developer or Contractor. Thank you for your kind understanding. -- Bigul |