نظرة عامة على المشكلة
عند استخدام WP Job Manager مع WPML، فإن حذف مقالات الوظائف أو مقالات السير الذاتية من الواجهة الأمامية (لوحة تحكم الوظائف) لا يحذف ترجماتها تلقائياً. حتى عندما يكون خيار «عند حذف مقالة، احذف الترجمات أيضاً» مفعلاً في «WPMLإعداداتمزامنة المقالات والصفحات».
حل بديل مؤقت
تم إصلاح هذه المشكلة. يحل التحديث إلى أحدث إصدار المشكلة على موقعك، لذا لا تحتاج إلى هذا الحل البديل المؤقت إلا إذا لم تتمكن من التحديث بعد.
يرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
لمقالات الوظائف
- افتح /wp-content/plugins/wp-job-manager/includes/class-job-dashboard-shortcode.php
- ابحث عن السطر 466
- استبدل:
case 'delete': // Trash it. wp_trash_post( $job_id );
- بـ:
case 'delete': // Trash it. // WPML workaround for compsupp-7729 if ( class_exists('Sitepress') ) { $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 ); } } } else { wp_trash_post( $job_id ); }
لمقالات السير الذاتية
- افتح /wp-content/plugins/wp-job-manager-resumes/includes/class-wp-resume-manager-shortcodes.php
- ابحث عن السطر 125
- استبدل:
case 'delete': // Trash it. wp_trash_post( $resume_id );
- بـ:
case 'delete': // Trash it. // WPML workaround for compsupp-7757 if ( class_exists('Sitepress') ) { $trid = apply_filters( 'wpml_element_trid', NULL, $resume_id , 'post_resume' ); $translations = apply_filters( 'wpml_get_element_translations', NULL, $trid, 'resume' ); if ( !empty( $translations ) ) { foreach ( $translations as $lang => $translation ) { $translation_id = absint( $translation->element_id ); wp_trash_post( $translation_id ); } } } else { wp_trash_post( $resume_id ); }