Skip Navigation

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.

Tagged: 

This topic contains 17 replies, has 0 voices.

Last updated by Bigul 1 month, 3 weeks ago.

Assisted by: Bigul.

Author Posts
December 11, 2024 at 12:18 pm #16503349

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hi Eric,

Thank you for the confirmation. Our compatibility team will be in touch with the WP Jobmanager team about this. We will get back to you on this as soon as possible. Please wait.

--
Thanks!

Bigul

December 13, 2024 at 8:40 pm #16512619
ericH-23

Hi,
I discovered, that here the same error is at the resume manager, so the resumes are also duplicated like the jobs and if they are deleted in the frontend, only the current is deleted and not the copies, like at the jobs.

Do you have here a code also for resumes? And would you please escalate this also, because it is the same topic?

Or shall I show this in the sandbox also?

Thanks, kind regards
Eric

New threads created by Bigul and linked to this one are listed below:

https://wpml.org/forums/topic/resume-manager-posts-are-not-deleted/

December 16, 2024 at 9:29 am #16516376

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+01:00)

Hi Eric,

Thank you for the updates. We can't add this fixed code to the functions.php file. We contacted the Job Manager plugin team a few months back for another conflict like this, but we haven't received feedback yet. So can you please update them about this bug.

Please note that I have opened a new ticket for the Resume Manager issue. As per our support policies, we can address only one issue per ticket. This approach helps us serve you better and avoid discussing multiple problems within a single ticket. I will respond to the new ticket shortly. Thank you for your understanding.

--
Thanks!

Bigul