- Status
- Gelöst
- Gemeldet für
- WPML Multilingual for BuddyPress and BuddyBoss 1.7.0
- Gelöst in
- BuddyPress Multilingual 1.8.0
- Zugehöriges Plugin/Theme
- BuddyBoss Platform
- Themen-Tags
- Compatibility
Übersicht über das Problem
Wenn in BuddyBoss Diskussionen übersetzt werden, haben die übersetzten Versionen möglicherweise nicht die korrekte Forenzuweisung und werden unter Umständen nicht im Foren-Loop angezeigt. Dieses Problem kann dazu führen, dass übersetzte Diskussionen im Frontend nicht unter den entsprechenden übersetzten Foren angezeigt werden.
Problemumgehung
Bitte stellen Sie sicher, dass Sie ein vollständiges Backup Ihrer Website haben, bevor Sie fortfahren.
- Gehen Sie zur Seite WPML > Einstellungen > Benutzerdefinierte XML-Konfiguration.
- Fügen Sie das folgende XML hinzu:
<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> - Öffnen Sie die Datei functions.php Ihres Themes.
- Fügen Sie den folgenden PHP-Code hinzu:
// 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); - Nehmen Sie eine kleine Änderung an der ursprünglichen Diskussion vor und speichern Sie sie.
- Aktualisieren Sie die Übersetzung