This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was experiencing issues with the WPML setting 'When deleting a post, delete translations as well' not functioning correctly for duplicated posts when deleted from the frontend. The main post would be deleted, but its duplicates would remain.
Solution:
We recommended the following steps after ensuring a full site backup:
1) Navigate to the
/wp-content/plugins/wp-job-manager/includes/
folder.
2) Open the
class-job-dashboard-shortcode.php
file for editing.
3) Locate line number 466 and replace the existing code with:
From
case 'delete': // Trash it. wp_trash_post( $job_id );
To
case 'delete': // Trash it. // WPML workaround for compsupp-7729 $trid = apply_filters( 'wpml_element_trid', NULL, $job_id , 'post_job_listing' ); $translations = apply_filters( 'wpml_get_element_translations', NULL, $trid, 'job_listing' ); if ( !empty( $translations ) ) { foreach ( $translations as $lang => $translation ) { $translation_id = absint( $translation->element_id ); wp_trash_post( $translation_id ); } }
This code ensures that when a job post is deleted from the frontend, all its translations are also trashed, regardless of the WPML setting.
If this solution does not resolve your issue or seems irrelevant due to updates or differences in your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket at WPML support forum.
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.
This topic contains 17 replies, has 0 voices.
Last updated by 1 month, 3 weeks ago.
Assisted by: Bigul.