- Trạng thái
- Đang mở
- Plugin/giao diện liên quan
- Advanced Custom Fields
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Khi sử dụng ACF – Advanced Custom Fields với plugin ACFML, nếu một trường Clone được đặt thành Sao chép một lần, không thể truy xuất các giá trị của trường bằng ngôn ngữ gốc trên giao diện người dùng. Sự cố này xảy ra khi nhóm trường chứa trường Clone được đặt thành Các trường khác nhau giữa các ngôn ngữ hoặc khi trường được đặt thủ công thành Sao chép một lần ở chế độ Expert.
Giải pháp tạm thời
Vui lòng đảm bảo tạo một bản sao lưu toàn bộ trang web của bạn trước khi tiếp tục.
- Mở tệp …wp-content/plugins/acfml/classes/class-wpml-acf-custom-fields-sync.php.
- Tìm dòng 42.
- Thay thế:
public function clean_empty_values_for_copy_once_field( $value, $post_id, $field ) { if ( '' === $value && ! $this->value_has_been_emptied( $field ) && isset( $field['wpml_cf_preferences'] ) && WPML_COPY_ONCE_CUSTOM_FIELD === $field['wpml_cf_preferences'] && ! $this->isFieldType( $field, 'group' ) ) { $value = null; } return $value; } - Bằng:
// WPML Workaround for compsupp-7767 public function clean_empty_values_for_copy_once_field( $value, $post_id, $field ) { if ( '' === $value && ! $this->value_has_been_emptied( $field ) && isset( $field['wpml_cf_preferences'] ) && WPML_COPY_ONCE_CUSTOM_FIELD === $field['wpml_cf_preferences'] && ! $this->isFieldType( $field, 'group' ) && ! $this->isFieldType( $field, 'clone' ) ) { $value = null; } return $value; }