WPML
Trạng thái
Đang mở
Plugin/giao diện liên quan
WP Job Manager
Thẻ chủ đề
Compatibility

Tổng quan về lỗi

Khi sử dụng WP Job Manager với WPML, việc xóa các bài viết Job hoặc bài viết Resume từ frontend (Bảng điều khiển Job) không tự động xóa các bản dịch của chúng. Ngay cả khi tùy chọn “Khi xóa một bài viết, xóa luôn các bản dịch” được kích hoạt trong “WPML > Cài đặt > Đồng bộ hóa bài viết và trang”.

Giải pháp tạm thời

Vui lòng đảm bảo bạn có bản sao lưu toàn bộ trang web trước khi tiếp tục.

Đối với bài viết Job


  • Mở /wp-content/plugins/wp-job-manager/includes/class-job-dashboard-shortcode.php

  • Tìm dòng 466

  • Thay thế:
    				case 'delete':
    					// Trash it.
    					wp_trash_post( $job_id );

  • Bằng:
    				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 );
    					}

Đối với bài viết Resume


  • Mở /wp-content/plugins/wp-job-manager-resumes/includes/class-wp-resume-manager-shortcodes.php

  • Tìm dòng 125

  • Thay thế:
    				case 'delete':
    					// Trash it.
    					wp_trash_post( $resume_id );

  • Bằng:
    				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 );
    					}

Tất cả các lỗi đã ghi nhận →