- Trạng thái
- Đã được giải quyết bởi nhà phát triển
- Đã giải quyết trong
- Blocksy Companion 2.0.33
- Plugin/giao diện liên quan
- Blocksy
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Trong giao diện Blocksy, khi sử dụng tính năng Products Tab với WPML, các tab được dịch sang ngôn ngữ phụ có thể hiển thị không chính xác bằng ngôn ngữ gốc trên giao diện người dùng.
Giải pháp tạm thời
Vui lòng đảm bảo bạn có một bản sao lưu đầy đủ cho trang web của mình trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/blocksy-companion-pro/framework/premium/extensions/woocommerce-extra/features/custom-tabs/feature.php
- Tìm dòng 139.
- Thay thế:
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, ]);
- Bằng:
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, // WPML Workaround for compsupp-7255 - PART 1 'suppress_filters' => false ]);
- Sau đó, mở tệp …/wp-content/plugins/blocksy-companion-pro/framework/features/conditions/rules-resolver.php
- Tìm dòng 364.
- Thay thế:
if ( isset($rule['payload']) && isset($rule['payload']['post_id']) && $post_id && intval($post_id) === intval($rule['payload']['post_id']) ) { return true; } - Bằng:
// WPML Workaround for compsupp-7255 - Part 2 if ( class_exists('Sitepress') ) { $rule['payload']['post_id'] = apply_filters( 'wpml_object_id', $rule['payload']['post_id'], get_post_type($rule['payload']['post_id']) , TRUE ); } if ( isset($rule['payload']) && isset($rule['payload']['post_id']) && $post_id && intval($post_id) === intval($rule['payload']['post_id']) ) { return true; }