- 状态
- 已解决
- 报告针对
- WPML Multilingual for BuddyPress and BuddyBoss 1.7.0
- 解决于
- BuddyPress Multilingual 1.8.0
- 相关插件/主题
- BuddyBoss Platform
- 主题标签
- Compatibility
问题概述
在 BuddyBoss 中,翻译讨论时,翻译后的版本可能没有正确的论坛分配,并且可能不会显示在论坛循环中。此问题可能导致翻译后的讨论无法在前端相应的已翻译论坛下显示。
临时解决方法
在继续操作之前,请确保对您的站点进行完整备份。
- 前往 WPML > 设置 > 自定义 XML 配置页面。
- 添加以下 XML:
<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> - 打开您主题的 functions.php 文件。
- 添加以下 PHP 代码:
// 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); - 对原始讨论进行细微修改并保存。
- 更新其翻译