WPML
Trạng thái
Đã được giải quyết bởi nhà phát triển

Tổng quan về lỗi

Khi bạn thử dịch nội dung được xây dựng bằng Muffin Builder của BeTheme, nội dung đã dịch không được hiển thị trên giao diện người dùng, hoặc nội dung bị mã hóa như hiển thị trong ảnh chụp màn hình dưới đây:

Nội dung được tạo bằng Muffin Builder bị mã hóa

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

Đảm bảo sao lưu toàn bộ trang web của bạn trước khi tiếp tục.

  1. Cập nhật lên phiên bản mới nhất của Betheme
  2. Truy cập Betheme > Theme Options > Global > Nâng cao > Muffin Builder data storage và chọn tùy chọn Serialized | Readable format, required by some plugins
  3. Mở tệp wp-content/themes/betheme/functions/theme-functions.php và tìm kiếm đoạn mã dưới đây:
    /*
     * WPML | Workaround for compsupp-5901
     */
    
    function mfn_wpml_encode_custom_field( $custom_field_val, $custom_field_name ) {
      if ( $custom_field_name === 'mfn-page-items' ) {
    	  $custom_field_val = maybe_unserialize( base64_decode($custom_field_val) );
    	}
    	return $custom_field_val;
    }
    add_filter( 'wpml_encode_custom_field', 'mfn_wpml_encode_custom_field', 10, 2 );
    
    function mfn_wpml_decode_custom_field( $custom_field_val, $custom_field_name ) {
    	if ( $custom_field_name === 'mfn-page-items' ) {
    		$custom_field_val = base64_encode( serialize($custom_field_val) );
    	}
    	return $custom_field_val;
    }
    add_filter( 'wpml_decode_custom_field', 'mfn_wpml_decode_custom_field', 10, 2 );
  4. Thay thế bằng đoạn mã dưới đây:
    /*
     * WPML | Workaround for compsupp-5901
     */
    function mfn_wpml_encode_custom_field( $custom_field_val, $custom_field_name ) {
        if ( $custom_field_name === 'mfn-page-items' ) {
            $custom_field_val = base64_encode( serialize($custom_field_val) );
        }
        return $custom_field_val;	
    }
    add_filter( 'wpml_encode_custom_field', 'mfn_wpml_encode_custom_field', 10, 2 );
    
    function mfn_wpml_decode_custom_field( $custom_field_val, $custom_field_name ) {
    	if ( $custom_field_name === 'mfn-page-items' && is_string($custom_field_val) ) {
    		$custom_field_val = maybe_unserialize( base64_decode($custom_field_val) );
    	}
    	return $custom_field_val;
    }
    add_filter( 'wpml_decode_custom_field', 'mfn_wpml_decode_custom_field', 10, 2 );
  5. Nếu bạn đã bắt đầu dịch các trang của mình, hãy chỉnh sửa trang gốc và lưu.
  6. Cập nhật bản dịch và nội dung sẽ khả dụng.

Các bước tiếp theo

Chúng tôi đã liên hệ với các nhà phát triển BeTheme và Muffin Builder, họ sẽ triển khai bản sửa lỗi trong thời gian sớm nhất. Bạn không cần thực hiện thêm thao tác nào vào lúc này.

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