WPML
Trạng thái
Đã giải quyết
Được báo cáo cho
WPML Multilingual for BuddyPress and BuddyBoss 1.7.0
Đã giải quyết trong
BuddyPress Multilingual 1.8.0
Plugin/giao diện liên quan
BuddyBoss Platform
Thẻ chủ đề
Compatibility

Tổng quan về lỗi

Trong BuddyBoss, khi các cuộc thảo luận được dịch, các phiên bản đã dịch có thể không được gán đúng diễn đàn và có thể không hiển thị trong vòng lặp diễn đàn. Vấn đề này có thể dẫn đến việc các cuộc thảo luận đã dịch không xuất hiện bên dưới các diễn đàn đã dịch tương ứng trên frontend.

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

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


  • Truy cập trang WPML > Cài đặt > Cấu hình XML tùy chỉnh.

  • Thêm mã XML sau:
    <wpml-config>
      <custom-fields>
        <custom-field action="copy-once">_bbp_forum_id</custom-field>
        <custom-field action="copy-once">_bbp_last_active_time</custom-field>
        <custom-field action="copy-once">_bbp_activity_id</custom-field>
        <custom-field action="copy-once">_bbp_author_ip</custom-field>
        <custom-field action="copy-once">	_bbp_reply_count</custom-field>
        <custom-field action="copy-once">_bbp_reply_count_hidden</custom-field>
        <custom-field action="copy-once">_bbp_topic_id</custom-field>
        <custom-field action="copy-once">_bbp_voice_count</custom-field>
      </custom-fields>
    </wpml-config>

  • Mở tệp functions.php trong giao diện của bạn.

  • Thêm mã PHP sau:
    // WPMl Workaround for compsupp-7242
    function wpml_compsupp7242_filter_bbp_get_topic_forum_id($forum_id, $topic_id) {
        if ( class_exists('Sitepress') ) {
            $forum_id = apply_filters('wpml_object_id', $forum_id, get_post_type($forum_id), TRUE);
        }
    
        return $forum_id;
    }
    
    add_filter('bbp_get_topic_forum_id', 'wpml_compsupp7242_filter_bbp_get_topic_forum_id', 10, 2);
    
    // I'm not sure if this other filter is really needed, but I'm also adding here for reference
    function wpml_compsupp7242_filter_bbp_get_forum_id($bbp_forum_id, $forum_id) {
        if ( class_exists('Sitepress') ) {
            $bbp_forum_id = apply_filters('wpml_object_id', $bbp_forum_id, get_post_type($bbp_forum_id), TRUE);
        }
    
        return $bbp_forum_id;
    }
    
    add_filter('bbp_get_forum_id', 'wpml_compsupp7242_filter_bbp_get_forum_id', 10, 2);
  • Thực hiện một thay đổi nhỏ trên cuộc thảo luận gốc và lưu lại.
  • Cập nhật bản dịch của nó

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